2011-01-11 68 views
0

當我在Firfox 3.6.13中運行它並單擊鏈接或按鈕時,警報就會出現,但基本上是不可見的。它顯示了框的輪廓,並且警告的內容僅在我將鼠標懸停在其上方後纔會顯示。javascript alert在firefox中不渲染(不可見)

這是什麼造成的?它按預期工作在IE 7

<?php 
if (isset($_GET['link'])){ 
?> 
    <script>alert('link!');location.href='test.php';</script> 
<?php 
} 
if (isset($_GET['button'])){ 
?> 
    <script>alert('button!');location.href='test.php';</script> 
<?php 
} 
else { 
    print "<a href=\"test.php?link\">click me</a><br/>"; 
    print "<input type=\"button\" onClick=\"location.href='test.php?button'\" value=\"button\">"; 
} 
?> 
+4

發佈生成的代碼。上面的代碼沒有在瀏覽器中運行。 – 2011-01-11 16:33:40

回答

0

我得到你的代碼相同的行爲,但如果我把警報的功能,當人體被加載時調用(即:身體的onload =「負荷();「) 一切安好。