sacred
Junior Member
 
USA
153 Posts |
Posted - 03 August 2003 : 09:09:52
|
Hi, I have been working on opening up a child window for a parent window. And having the child window manipulate the parent window. I broke it down into an easy example. Now the code below I have tried in a single web page and know that setting the length to 0 and the new Option actually does work within the confines of a single web page. However, I keep getting an exception thrown when those lines run in a child window manipulating the parent window. Actually the error I think is boogus as it says "server exception ..." when it runs the child window. Becuase it is not running on a server it is running off my local HD. I eve tried naming the parent and going to the child and referencing through the name and got a "testing is undefined error" within the child window.
Here is the code: PARENT WINDOW <html> <head> <title>Testing</title> </head>
<body> <form name="form1" method="post"> <select name="select1" onChange="deleteAdd ();"> <option value="1">hi 1</option> <option value="3">hi 3</option> <option value="2">hi 2</option> </select> <select name="select2"> <option value="1">there 1</option> <option value="3">there 3</option> <option value="2">ther 2</option> </select> </form> <SCRIPT> window.name="testing" window.open('testing2.html','testing2','height=200; width=200'); </SCRIPT> </body> </html>
CHILD WINDOW <html> <head> <title>Testing2</title> </head> <script language="javascript"> function deleteAdd (){ opener.document.form1.select2.length=0; opener.document.form1.select2.options[0]= new Option ('Good Bye 1','1'); opener.document.form1.select2.options[1]= new Option ('Good Bye 2','2'); opener.document.form1.select2.options[2]= new Option ('Good Bye 3','3'); } </script> <body onload="deleteAdd();"> hi there </body> </html>
any ideas why it is throwing the server exception?
Yours in deepest gratitude,
Sacred
|
Edited by - sacred on 03 August 2003 09:42:45 |
|