开发者

window.location onload in Firefox

Probably a simple question for everyone. This displays the ale开发者_JS百科rt with the location in Chrome and Safari but it doesn't work in Firefox

<html> 
<head> 
<script type="text/javascript"> 
function onload() {
var loc = window.location;
alert("url is " +loc);
return false;
}
</script> 
</head> 
<body onload="onload()"> 
</body> 
</html> 

Any Ideas


Don't use names like onload.

<html> 
<head> 
<script type="text/javascript"> 
function loader() {
    var loc = window.location;
    alert("url is " +loc);
    return false;
}
</script> 
</head> 
<body onload="loader()"> 
</body> 
</html> 
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜