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

communicating with windows from different servers

Status
Not open for further replies.

rturner003

Programmer
Nov 20, 2001
21
GB
On Microsoft IE I am calling up a page in a pop up window and it is also stored on a different server. My problem is communicating between these windows/pages. Window.opener just stops the JS working.

The code that calls the popup is a follows:

function popUp(URL) {
day = new Date()
id = day.getTime()
eval("page" + id + " = window.open(URL, '" + id + "','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=350,height=400');")
}

function getAdds() {
search_chars=document.myform.v17.value
if (search_chars.length==0) return
window.name='fred'
url1="popUp(url1)
}

The window.name line did not seem to have any effect. I am sure there is something I am missing!!!

Robert T Turner
 
window.name refers to the current window the code is in, so all you've done is name that 'fred'. Unless you store the "page" + id variable name somewhere to refer to later, it won't be accessible for anything.

window.opener only works inside the popup window, so unless you're writing the HTML for the popup window, it won't do what it sounds like you're attempting.

If you want to create variables on the fly, you should probably use an Array(), which handles the dynamic creation and still gives you access to all the elements.
 
You may have problems communicating between windows containing urls from different domains anyway. It's part of the "same domain" security rule. Would you want one web site you were looking at the be able to see and/or talk to another web site you were looking at? That's the reason for the rule. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top