aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Urgent!! Opener is empty in javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Urgent!! Opener is empty in javascript" Watch "Urgent!! Opener is empty in javascript" New topic
Author

Urgent!! Opener is empty in javascript

yian
Greenhorn

Joined: Jan 08, 2002
Posts: 1
Dear all,
I meet one serious problem in my project.
the opener is null if I open webpage from server A and use javascript 'window.open' to open a new window for displaying a page in server B.
But it works if I put these two html pages in one server
The sample codes are as following,
The alert window is shown if I put test1.html and test.html in serverA.
But the alert window is not shown if I put test.html in serverB but I put test1.html in serverA.
Does anybody can help me?
-----test.html----------
<html>
<head>
</head>
<body>
<script>
window.name = "testWinow"
window.open("http://serverA/test1.html")
</script>
</body>
</html>
----end of test.html--------
-------test1.html--------
<html>
<head>
</head>
<body>
<script>
alert(opener.name)
</script>
</body>
</html>
-------end of test1.html---------
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Ah, you found out the wonderful security restrictios with javascript. The files have to be on the same server I am afraid. This is to keep people from using other peoples information. Stinks...doesn't it...
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4339
    
    2

yian,
I hate to say this but, your name does not comply with the Javaranch naming guidelines which can be found at http://www.javaranch.com/name.jsp
please register again with a valid name.


SCJP
Visit my download page
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

can you open a new window that contains a page on your site then use that page to automatically redirect to a page on another domain?
eg http://one.com/one.html

Then send them somewhere else

or similar...
Just a thought. Even if you got it to work, its a bit of a hack so I wouldn't trust it to continue working...
Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Urgent!! Opener is empty in javascript
 
Similar Threads
Windows XP Popup blocking
how to submit form to parent window
Populating fields on a webpage based on the remote webpage data
Opening a child window
Opening a webpage in same window using javascript without anchor tag