Click to See Complete Forum and Search --> : pop-up window external url in frames


deej80
08-02-2003, 12:20 PM
I have a site that uses 3 frames (top, middle and bottom section). The top and bottom section load html pages from the original server. The middle section loads a html page from another server. So far no problems.

However in the html file that is loaded from the external server I need to pop-up a window. Apparently it is not aloud to pop-up windows within frames that load an external URL (security issues).

I'm not that good at Javascript and besides this page has not originally been developped by me (frames are not exactly great). However I looked around and it seems that I have to use enableExternalCapture() and captureEvents(). In my search I found these few words on the matter which I pasted below:

"When a window with frames wants to capture events in pages loaded from different locations (servers), you need to use captureEvents in a signed script and precede it with enableExternalCapture. You must have the UniversalBrowserWrite privilege."

Basically I have no idea how to construct a valid Javascript code that will allow me to open a pop-up window in a frame loading an external URL. I hope anyone will be able to help me. Thanks in advance.

Khalid Ali
08-02-2003, 10:23 PM
simply put...bad idea....

deej80
08-02-2003, 10:38 PM
Well, after looking at the situation for about 5 more minutes I just gave up and decided it was time to get rid of the frames alltogether. It's more work for me, but in the end the result will be better.

KarterJK
08-02-2003, 10:43 PM
I am not sure I understand what it is you are trying to do. It should be fairly straight forward

deej80
08-02-2003, 11:03 PM
Hehe. I thought it should be fairly straightforward too. Anyway I decided to go woth another solution. Bascially you can't load an external URL in a pop-up window that has been activitated from within a frame.

For example.

I have a file called index.html which is a framset with 3 sections (frames): top.html, middle.html and bottom.html. In middle.html I have a link that activates a pop-up window throught Javascript (with window.open or any other) which loads the URL http://www.otherserver.com/file.html. Now index.html, top.html, middle.html and bottom.html are located on http://www.myserver.com/. However as I indicated earlier the file I wan't to load in the pop-up window is located at a different server (myserver.com vs. otherserver.com).

For security reasons this method is not allowed. It is of course true that using frames is bad alltogether. Using frames with pop-up windows is really dumb. Using frames with pop-up windows that load an external URL is just suicide.

In theory it should be possible to make the above work. Unfortunatly my knowledge of Javascript is limited. Which in this case was a good thing, atleast I'll came up with something more suitable and less 1997.