HI
I am trying to create a link on a page which when clicked by the user would open a window and sign into it automatically. But when ever I try to edit the onload event on the child window through a button click on the parent window it gives me the error “window.onload is null or not an object” .Can’t it be done like this ?? if Yes then suggest any work around.
Thanks in Advance.
[SIZE=4]Code: –
[U]To open the new window
[COLOR=DarkOliveGreen]var globalChildWin = window.open(“Some URL”);
addLoadEvent(“newOnLoad()”)
[U]Function AddLoadEvent and newOnLoad: –
function addLoadEvent(func) {
var oldonload = globalChildWin.onload;
if (typeof window.onload != ‘function’) {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}
function newOnLoad()
{
var doc = window.document;
var frm = doc.forms[0];
frm.Name.value = “Ali”
}