我有一個簡單的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 “forceValue” 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><select></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>
這樣做。謝謝! – Jason 2011-06-10 12:12:56