【问题标题】:HTML slider causing IE script errorHTML 滑块导致 IE 脚本错误
【发布时间】:2011-06-09 13:33:35
【问题描述】:

我有一个简单的 HTML5 页面,我正在构建它以使用滑块解决一些问题。它们在最新版本的 Chrome (13+) 和 Firefox (4+) 中似乎很好。但是,IE9 给了我以下信息:

“Internet Explorer 限制此网页运行脚本或 ActiveX 控件。”

在我点击“允许被阻止的内容”之前,滑块现在会显示出来。在我点击允许后,它们工作得很好。

知道为什么 IE 会出现问题吗?

下面是页面代码:

<!DOCTYPE html>
<html>
<head>
<script src="http://www.frequency-decoder.com/demo/fd-slider/js/fd-slider.js"></script>
<link rel="stylesheet" type="text/css" media="screen, projection" href="http://www.frequency-decoder.com/demo/fd-slider/css/fd-slider.css" />
<link rel="stylesheet" type="text/css" media="screen, projection" href="http://www.frequency-decoder.com/demo/fd-slider/css/demo.css" />
</head>
<body>
<p>
    The following slider has the &#8220;forceValue&#8221; parameter set to TRUE, which
    forces the associated text input to show a valid value.
</p>
<label for="inputTest6" id="inputTest6Label">
    Range: 1 to 5 in steps of 1
</label>
<p>
    <input name="inputTest6" id="inputTest6" type="text" title="Range: 1 to 5 in steps of 1" value="2"  maxlength="6" />
</p>
<script> 
      fdSlider.createSlider({
        // Associate an input
        inp:document.getElementById("inputTest6"),
        // Declare a step
        step:1, 
        // Declare a maxStep
        maxStep:1,
        // Min value
        min:1,
        // Max value
        max:5,
        // Use the "tween to click point" animation
        animation:"tween",
        // Force the associated input to have a valid value
        forceValue:true
        });
      </script>
<p>
    The following slider has been associated with a <code>&lt;select&gt;</code>.
</p>
<label for="selectTest1" id="selectTest1Label">
    Select List with five options
</label>
<p>
    <select name="selectTest1" id="selectTest1">
        <option value="1">One</option>
        <option value="2">Two</option>
        <option value="3">Three</option>
        <option value="4" selected>Four</option>
        <option value="5">Five</option>
    </select>
</p>
<script> 
      fdSlider.createSlider({
        // Associate a select list
        inp:document.getElementById("selectTest1"),
        // Use the tween animation
        animation:"tween",
        // Keep the form element, in this case a select list, visible
        hideInput:false,
        // Give it the className "v-s2" which will make the slider 160px in height
        classNames:"v-s2"
        });
      </script>
</body>
</html>

【问题讨论】:

    标签: javascript internet-explorer html internet-explorer-9


    【解决方案1】:

    您是否尝试从与页面相同的域加载脚本?

    【讨论】:

      【解决方案2】:

      这将解决问题:转到工具-> Internet 选项-> 高级选项卡,滚动到安全部分并选中“允许活动内容在我的电脑上的文件中运行”。

      【讨论】:

      • 脚本托管在另一个域中,而不是在我的电脑上。即使这样可行,生产网站也不能接受要求用户在每次访问网站时更改其默认安全设置或点击横幅
      猜你喜欢
      • 1970-01-01
      • 2020-11-24
      • 2019-08-18
      • 2017-05-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-08
      • 2022-11-04
      相关资源
      最近更新 更多