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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JS variable assignment problem

Status
Not open for further replies.

Bastien

Programmer
May 29, 2000
1,683
CA
I have a situation like this:

On the parent (framed) page, i declare an object in js in a hidden frame

Code:
var xfilter = new Object();

Then from a child window, I am doing an AJAX call to fetch an xml snippet which comes back as an XML object via HTPPRequest.ResponseXML

What I want to do then is assign the xml object to the xfilter object via

Code:
//d is the object to the parent window's hidden frame
d = window.opener.parent.frames.hidden_work_area;
d.xfilter[key] = objXML;

However, this is is not working, giving an undefined error on the xfilter object. IS this a scoping issue in the js varxfilter?

How do I sort this out?



Bastien

I wish my computer would do what I want it to do,
instead of what I tell it to do...
 
Have you tried using "window.parent" instead of "window.opener.parent"?

I don't think "window.opener" is useful unless you are dealing with windows opened using "window.open" - which is not the case with a frame.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
nope, the addressing of the frame is correct.

I am currently playing with extending the var d to include the object xfilter to so this:

Code:
d = window.opener.parent.frames.hidden_work_area.xfilter;
d[key] = objXML;

I seem to be having more success with this approach

Bastien

I wish my computer would do what I want it to do,
instead of what I tell it to do...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top