【问题标题】:can't get my script tags to function in my html page无法让我的脚本标签在我的 html 页面中运行
【发布时间】:2015-01-16 19:52:13
【问题描述】:

我正在为网页制作信用卡信息表单,而我在网上找到的脚本仅适用于 Safari 以制作我想要的样式。

这是我复制并粘贴到我的 html 头部的内容:

    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">


  <!-- Start BounceX tag. Deploy at the beginning of document head. -->
        <script>
        (function(d) {
            var e = d.createElement('script');
            e.src = d.location.protocol + '//bounceexchange.com/tag/426/i.js';
            e.async = true;
            d.getElementsByTagName("head")[0].appendChild(e);
        }(document));
        </script>
<!-- End BounceX Tag-->

    <!--Optimizely  -->
  <script src="//cdn.optimizely.com/js/191337197.js"></script>


  <!-- ClickTale Top part -->
<script type='text/javascript'>
    document.write(unescape("%3Cscript%20src='" +
                            (document.location.protocol == 'https:' ?
                            'https://clicktalecdn.sslcs.cdngc.net/' :
                            'http://cdn.clicktale.net/') +
                            "www11/phc/e9344b9e-32db-42a2-989b-468e39690d0a.js'%20type='text/javascript'%3E%3C/script%3E"));
</script>
<!-- ClickTale end of Top part -->

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>

http://jsfiddle.net/gxyhkd3j/

这是 Safari 与 Chrome 中的外观。

我想要的,在 Safari 中:http://imgur.com/dOl03G1

我在 Chrome 中得到了什么:http://imgur.com/nYwAcMO

【问题讨论】:

  • 您正在使用 2 个 jquery 移动库和 2 个 jquery 库。我没有测试过你的代码,但它们会发生冲突。尝试只使用其中一种。
  • 另外,你能发布你的html吗?
  • 屏幕截图看起来像 Chrome 上的不安全内容警告(地址栏上的盾牌图标)。可能是 HTTPS 问题(在这种情况下,您需要使用相对链接或严格使用 SSL)。

标签: javascript jquery html google-chrome safari


【解决方案1】:

你应该只把它放在你的标题中。只有一个jquery,一个jquery mobile,一个jquery mobile css。你使用了重复,会有冲突问题。

<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">

【讨论】:

    猜你喜欢
    • 2015-09-09
    • 1970-01-01
    • 2017-03-28
    • 1970-01-01
    • 1970-01-01
    • 2015-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多