Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onload problems

Status
Not open for further replies.

ugly

Programmer
Jul 5, 2002
70
GB
I have used the onload function to trigger the opening of a secondary window. This secondary window opens fine. I would like to trigger another event when the secondary window has loaded again using the onload function. However I can't get this to work. Thanks for any help



<head>
<script language="javascript">

function loadwebpage()
{
window.open(" "first", "toolbar=yes,location=yes,scrollbars=yes,resizable=yes,width=300,height=300")
//the next line does not work
first.onLoad = function() { alert ("pop up has fully loaded";)}
}
</script>
</head>
<body onload = "loadwebpage()">

</body>
</html>
 
Try this variation:
Code:
var first = window.open("[URL unfurl="true"]http://www.rhizome.org/",[/URL] "first", "toolbar=yes,location=yes,scrollbars=yes,resizable=yes,width=300,height=300");

Lee
 
One quick addition, make this:
Code:
first.onLoad = function() { alert ("pop up has fully  loaded";)}

THIS:

Code:
first.onLoad = [!]new[/!] function() { alert ("pop up has fully  loaded";)}

I did test this with and without

[small]"Mom........MEATLOAF!!!! F***!!!!"[/small]
<.
 
HAHAHAH..... one more thing.....

Put this after the first.onload statement:

Code:
first.focus();



[small]"Mom........MEATLOAF!!!! F***!!!!"[/small]
<.
 
thanks guys, have modified but still problems alert message still not showing here is my code-

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html xmlns="<head>
<script language="javascript">


function loadwebpage()
{


var first = window.open(" "first", "toolbar=yes,location=yes,scrollbars=yes,resizable=yes,width=300,height=300");
//first.onLoad = new function() { alert ("pop up has fully loaded";)}
//first.focus();


}

</script>
<title>Main Window</title>
</head>
<body onload = "loadwebpage()">



</body>
</html>
 
is it cause those two lines are commented out?

Code:
//first.onLoad = new function() { alert ("pop up has fully  loaded";)}
//first.focus();

??

[small]"Mom........MEATLOAF!!!! F***!!!!"[/small]
<.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top