0
<div class="yui-gd">
<div class="yui-u first"><label for="${args.htmlid}-addContent">${msg("label.HowToAddContent")}:</label></div>
<div class="yui-u">
<select id="addContent" name="addContent" onchange="dropdown(this)">
<option value="1" selected="selected">${msg("label.generateFromDescription")}</option>
<option value="2">${msg("label.uploadFile")}</option>
</select>
</div>
</div>
<script type="text/javascript">//<![CDATA[
function dropdown(sel){
//if(document.getElementById("addContent").value == "1")
if(sel.value == "0"){
document.getElementById('desc').style.display = 'block'
}
else {
document.getElementById('desc').style.display = 'none'
}
}
//]]></script>
我寫它是因爲我想添加事件處理程序到選擇框中,它在Firefox中運行良好,但在IE中它總是拋出空異常。 即使通過我使用attachEvent,它仍然無法在IE中工作。 如果我在上面使用document.getElementById(「addContent」),它總是會拋出空異常!但是,所有這些東西在Firefox中運行良好!alfresco ----如何將事件處理程序添加到衝浪模板中?
有人能告訴我爲什麼嗎? 在此先感謝!