开发者

javascript alert not rendering (invisible) in firefox

开发者 https://www.devze.com 2023-02-03 11:39 出处:网络
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 a

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消