DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> 關於JavaScript >> ie6下點a標簽不會submit把javascript:void(0)改成###
ie6下點a標簽不會submit把javascript:void(0)改成###
編輯:關於JavaScript     

今天解決一BUG,在ie6下點a標簽不會submit,原來在a的href上寫的是javascript:void(0);把javascript:void(0)改成###,問題解決.但是如果這個html是程序員噴的,那可就要走大流程了.咨詢大師,於是留下了這千古絕唱.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <title></title>
 <script type="text/javascript">
window.onload = function() {
    document.getElementById('a1').onclick = function() {
        setTimeout(function() {
            document.forms[0].submit();
        }, 1);
    }
 }
 </script>
</head>
<body>
 <form action="VoteSubmit.aspx" id="form1">
 <input type="text" id="t1" />
 </form>
 <a href="javascript:void(0)" id="a1">aaa</a>
</body>
</html>

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved