嗨,大家好我無法讓我的代碼正確顯示html代碼,我有。基本上,我正在檢查變量hundo等於3,然後讓腳本顯示一個表單。我測試了代碼,以便在等於3時顯示警告消息,但是當我使用document.write時,它無法工作。我的猜測是,問題在於有...在javascript中使用html的麻煩?
<script>
setInterval(function(){
if(hundo == '3'){
document.open();
document.write("<form action="insert.php" method="post">
Link URL: <input type="text" name="linkurl" />
<input type="submit" />
</form>");
document.close();
}
}, 1000);
</script>
你說的做完整意義上的和但它仍然不起作用。 – Twister 2012-01-02 19:22:33
「它仍然沒有工作」 - 意思_what_究竟是什麼?錯誤控制檯說什麼? – Oded 2012-01-02 19:27:46
錯誤控制檯中沒有提供任何形式,當hundo = 3時不顯示。 – Twister 2012-01-02 19:29:42