javascript alert not rendering (invisible) in firefox
When I run this in Firfox 3.6.13 and click either the link or the button, 开发者_StackOverflow中文版the alert appears but is basically invisible. It shows the outline of a box and the content of the alert only appears after I hover over it.
What is causing this? It works as expected in 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\">";
}
?>
I was getting the same behaviour with your code, but if I put the alerts in a function that gets called when the body is loaded (i.e. : body onload="load();") everything is fine.
精彩评论