2011-06-09 100 views
0

我有一个简单的HTML5页面,我正在构建一些滑块的东西。在Chrome(13+)和Firefox(4+)的最新版本中,它们似乎很好。但是,IE9给我以下消息:HTML滑块导致IE脚本错误

“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> 

回答

2

你尝试从同一个域中的页面加载脚本?

+0

这样做。谢谢! – Jason 2011-06-10 12:12:56

-2

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

+2

脚本托管在另一个域中,而不是在我的电脑上。即使这样做,生产网站也不能要求用户每次访问网站时都要更改其默认安全设置或点击横幅 – 2012-03-07 15:34:19