The specification says that the onLoad() method is to be invoked in the <BODY> tag. Can I declare the onLoad within the JavaScript instead? The following is giving me an error.
function init()
{
var s = document.getElementsByTagName("A"
for(var i = 0; i < s.length; i++)
{
s.attachEvent("onclick", function(){if(this.hostname != document.location.hostname){var c = confirm('Are you sure you want to leave my site?');if(!c){return false;}}});
}
}
this.window.onLoad() = init;
function init()
{
var s = document.getElementsByTagName("A"
for(var i = 0; i < s.length; i++)
{
s.attachEvent("onclick", function(){if(this.hostname != document.location.hostname){var c = confirm('Are you sure you want to leave my site?');if(!c){return false;}}});
}
}
this.window.onLoad() = init;