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>
精彩评论