2011-06-09 103 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