File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Urgent!! Opener is empty in javascript


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 '' 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?
<script> = "testWinow""http://serverA/test1.html")
----end of test.html--------
-------end of test1.html---------
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
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: 4351

I hate to say this but, your name does not comply with the Javaranch naming guidelines which can be found at
please register again with a valid name.

Visit my download page
David O'Meara

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?

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...
I agree. Here's the link:
subject: Urgent!! Opener is empty in javascript
It's not a secret anymore!