Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 DOM with parent and child window
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

sacred
Junior Member

USA
153 Posts

Posted - 03 August 2003 :  09:09:52  Show Profile  Visit sacred's Homepage
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

sacred
Junior Member

USA
153 Posts

Posted - 03 August 2003 :  10:04:26  Show Profile  Visit sacred's Homepage
Figured it out finally. You can't do a new memory allocation in the child location and give it to the parent location.

Finally, I can go on

yours in deepest gratitude,

sacred
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.41 seconds. Powered By: Snitz Forums 2000 Version 3.4.07