Forum Moderators: open

Message Too Old, No Replies

opening a new window with a link from within a frame

passing value from frame to new window

         

jaguarxke

8:04 pm on May 27, 2003 (gmt 0)



I am opening a new window from a link and trying to dynamically pass information to a named areas of the file that is loaded in the newly named window. The link is being written out within a frame called "FraMain". Here is my code:

The link is calling a function called showItemAttributes(id,name) and looks like this:
<a href = "#" onClick="showItemAttributes('string1', 'string2'); return=false;>This is string 1</a>

The function looks like this:

function showItemAttributes(id,name)
{

var itemSummary = window.open('helpers/ItemSummary.htm','','width=710,height=650,left=50,top=50') ;
itemSummary.document.all.itemId.innerText = id
}

The file itemSummary.htm, which is being opened in the new window has the following code:

<body>

<div id="itemId"></div>

</body>

I am trying to assign the value of the string "id" to the defined area with the id "itemId". When I try to do this, I get an error message that says that document.all.itemId is not an object. The interesting thing is that I can run this same code when it is not within a Frame. I have used many opener and parent.parent type references, so I know that frame navigation can be a little tricky.

If someone out there can help me, I would greatly appreciate it. If there is any more information that anyone needs, please feel free to ask.

BlobFisk

2:35 pm on May 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, jaguarxke!

I'm not sure if you'd like to go down this route, but how about adding the id value to the URL (window.open('helpers/ItemSummary.htm?myId=someValue') and reading that from the popup window page?