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

Window.opener

Status
Not open for further replies.

karthikm75

Programmer
Apr 4, 2006
2
CA
Hi All,

I am in a weird quandry that I hope you guys can help me out of.

I have a Parent.html and Child.html. The Parent.html has a text box that needs to be populated by Child.html after the Child.html is accessed from Parent.html by clicking a button.

I use the "opener" object to get a handle of the opener window and subsequently the text box and populate the value.

The above solution works fine when Parent.html and Child.html are both on the same machine (my laptop) and when Child.html is accessed as a file. However, when Child.html is in IIS on another server, invoking it using a URL ( does not seem to give it enough rights to populate the Parent's text box.

Any one know why?
 
Yes - cross domain scripting is pretty much forbidden in JavaScript for security reasons.

You might try investigating the document.domain property to see if it helps, although I don't know how good its cross-browser support it is (possibly IE-only?)

Hope this helps,
Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Billy - thanks. It helped in that I was able to determine the two browser's domain which further solidified our fears of not being able to go down that road.

Karthik.
 
Would it be possible to put parent.html on the server as well?
It's just me, but it seems that would be a fairly easy fix for this problem.




I hope this helps;
Rob Hercules
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top