<tfoot id='DOllM'></tfoot>

        • <bdo id='DOllM'></bdo><ul id='DOllM'></ul>

        <small id='DOllM'></small><noframes id='DOllM'>

        <legend id='DOllM'><style id='DOllM'><dir id='DOllM'><q id='DOllM'></q></dir></style></legend>
        <i id='DOllM'><tr id='DOllM'><dt id='DOllM'><q id='DOllM'><span id='DOllM'><b id='DOllM'><form id='DOllM'><ins id='DOllM'></ins><ul id='DOllM'></ul><sub id='DOllM'></sub></form><legend id='DOllM'></legend><bdo id='DOllM'><pre id='DOllM'><center id='DOllM'></center></pre></bdo></b><th id='DOllM'></th></span></q></dt></tr></i><div id='DOllM'><tfoot id='DOllM'></tfoot><dl id='DOllM'><fieldset id='DOllM'></fieldset></dl></div>
      1. 如何仅在 IE 中加载脚本

        How to load a script only in IE(如何仅在 IE 中加载脚本)
          • <tfoot id='vvPgt'></tfoot>
              <tbody id='vvPgt'></tbody>

            <small id='vvPgt'></small><noframes id='vvPgt'>

            <i id='vvPgt'><tr id='vvPgt'><dt id='vvPgt'><q id='vvPgt'><span id='vvPgt'><b id='vvPgt'><form id='vvPgt'><ins id='vvPgt'></ins><ul id='vvPgt'></ul><sub id='vvPgt'></sub></form><legend id='vvPgt'></legend><bdo id='vvPgt'><pre id='vvPgt'><center id='vvPgt'></center></pre></bdo></b><th id='vvPgt'></th></span></q></dt></tr></i><div id='vvPgt'><tfoot id='vvPgt'></tfoot><dl id='vvPgt'><fieldset id='vvPgt'></fieldset></dl></div>

                <bdo id='vvPgt'></bdo><ul id='vvPgt'></ul>
                  <legend id='vvPgt'><style id='vvPgt'><dir id='vvPgt'><q id='vvPgt'></q></dir></style></legend>

                • 本文介绍了如何仅在 IE 中加载脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我只需要在 Internet Explorer 浏览器中触发特定脚本!

                  I need a particular script to be triggered in Internet Explorer browsers Only!

                  我试过了:

                  <!--[if IE]> 
                  <script></script>
                  <![endif]-->
                  

                  不幸的是,这实际上阻止了脚本的加载.

                  Unfortunately this actually stops the script from being loaded.

                  对于问我为什么需要这个的每个人:IE 在使用某些动画时会使滚动变得非常跳跃.为了解决这个问题,我需要实现一个为 IE 提供平滑滚动的脚本.我不想将它应用到其他浏览器,因为它们不需要它,而且这个脚本虽然使滚动更平滑也让它有点不自然.

                  For everyone asking why I need this: IE makes scrolling extremely jumpy when using some animations. In order to address this I need to implement a script that provides smooth scrolling to IE. I don't want to apply it to other browsers as they don't need it and this script although making the scrolling smoother also makes it a bit unnatural.

                  推荐答案

                  我很好奇为什么你特别需要针对 IE 浏览器,但是如果你确实需要这样做,下面的代码应该可以工作:

                  I'm curious why you specifically need to target IE browsers, but the following code should work if that really is what you need to do:

                  <script type="text/javascript">
                      if(/MSIE d|Trident.*rv:/.test(navigator.userAgent))
                          document.write('<script src="somescript.js"></script>');
                  </script>
                  

                  Regex 的前半部分 (MSIE d) 用于检测 Internet Explorer 10 及以下版本.后半部分用于检测IE11(Trident.*rv:).

                  The first half of the Regex (MSIE d) is for detecting Internet Explorer 10 and below. The second half is for detecting IE11 (Trident.*rv:).

                  如果浏览器的用户代理字符串与该模式匹配,它会将 somescript.js 附加到页面.

                  If the browser's user agent string matches that pattern, it will append somescript.js to the page.

                  这篇关于如何仅在 IE 中加载脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  业务场景:使用update语句去更新数据库字段。 原因:update接收值不正确。原来代码: $query = "UPDATE student SET date = now() WHERE id = $id";$result = $mysqli-query($query2) or die($mysqli-error); // 问题出现了在这句 $data = $result-fetch_ass
                  在开发JS过程中,会经常遇到两个小数相运算的情况,但是运算结果却与预期不同,调试一下发现计算结果竟然有那么长一串尾巴。如下图所示: 产生原因: JavaScript对小数运算会先转成二进制,运算完毕再转回十进制,过程中会有丢失,不过不是所有的小数间运算会
                  问题描述: 在javascript中引用js代码,然后导致反斜杠丢失,发现字符串中的所有\信息丢失。比如在js中引用input type=text onkeyup=value=value.replace(/[^\d]/g,) ,结果导致正则表达式中的\丢失。 问题原因: 该字符串含有\,javascript对字符串进行了转
                  如果content取的的事当前页面元素内容时,type类型应该为1 layer.open({type: 1,title: '内容区域',content: $('#DIV_EditUserInfo'), // 设置跳转的div,跳转到对应的页面area: ["920px", "250px"],}); 如果content取的的路径,或者某个页面,type类型应该为
                  Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
                  quot;Each child in an array should have a unique key propquot; only on first time render of page(“数组中的每个孩子都应该有一个唯一的 key prop仅在第一次呈现页面时)
                • <i id='oLoHa'><tr id='oLoHa'><dt id='oLoHa'><q id='oLoHa'><span id='oLoHa'><b id='oLoHa'><form id='oLoHa'><ins id='oLoHa'></ins><ul id='oLoHa'></ul><sub id='oLoHa'></sub></form><legend id='oLoHa'></legend><bdo id='oLoHa'><pre id='oLoHa'><center id='oLoHa'></center></pre></bdo></b><th id='oLoHa'></th></span></q></dt></tr></i><div id='oLoHa'><tfoot id='oLoHa'></tfoot><dl id='oLoHa'><fieldset id='oLoHa'></fieldset></dl></div>
                    <tbody id='oLoHa'></tbody>

                      <legend id='oLoHa'><style id='oLoHa'><dir id='oLoHa'><q id='oLoHa'></q></dir></style></legend>
                        <bdo id='oLoHa'></bdo><ul id='oLoHa'></ul>

                        <small id='oLoHa'></small><noframes id='oLoHa'>

                        • <tfoot id='oLoHa'></tfoot>