\'newWindow.document.all\' is not an object
Hola!I got this message when I\'m trying to execute a script:
\'newWindow.document.all\' is not an object
I guess I get this because the body of the newWindow hasn\'t loaded ready yet.
The code is like this (only intressting parts):
var newWindow =\"\";
function openNewWindow()
{
newWindow = window.open(\"http://fredrik/develop/IP3/lektion8/test8b.html\",\'opensmall\',\'width=770,height=445,toolbar=no\');
if (newWindow.opener == null)
{
newWind.opener = self;
}
}
function pickObject()
{
alert(\"pickObject\");
}
window.onload = openNewWindow;
newWindow.document.all.title.onmouseover = pickObject; //This row is responsible for the error.
This is the file that is in the newWindow:
<html>
<head>
<link href=\"css/test8.css\" rel=\"stylesheet\" type=\"text/css\"/>
</head>
<body id=\"body\">
<form name=\"form\">
<h1 id=\"title\" class=\"im\">Fönster 2</h1>
<div id=\"d\"></div>
<script language=\"Javascript\" src=\"js/test.js\"></script>
</form>
</body>
</html>
So know the questions:
1) Is it possible to wait for a document to be fully loaded?
2) Or perhaps someone can tell me an other way to access the newWindow member with id=\"title\"? OBS, not the tag title!
3) Perhaps someone se some other reason for this?
Best Regards
Fredrik
