PLEASE How to break out of an iframe?

B

boyscout

On a page I'm offering file download links which are each targeted to an
tiny 1-pixel X 1-pixel iframe on the same page. (If you care why, see
below.) Under certain conditions, I want to popup a window which is NOT
constrained within the iframe to which its creator page is targeted. But
since the download page is being targeted to the tiny iframe on the
application page, any popups or alerts I've tried creating from the download
page's code do not appear, presumably because they're being created inside
the "invisible" iframe.

Is there any method for asserting on a page that a window or alert should
NOT appear in the iframe to which the page was supposed to send its output?
I'm developing in ASP.NET, so can modify page HTML and Javascript just
before the page is sent to the browser.

The reason I'm targeting links to the tiny iframe is that when users select
a file for download, the standard Windows open / save / cancel dialog pops
up over the page they clicked rather than first opening a new "file
download" page. When download is complete and the dialog disappears the
original page remains ready for another user selection. The giant download
site tucows.com uses this technique. However if there's another way to get
this functionality I'm all ears!

1. User selects file for download on application page.

2. If no errors, standard Windows dialog pops up over application & download
proceeds without changing application page. When download completes, dialog
disappears and application page remains unchanged ready for further use.

3. If error, window or alert pops up over application. When closed,
application page remains unchanged ready for further use.

Thanks for ANY ideas.
 
K

kaeli

@twister01.bloor.is.net.cable.rogers.com>, (e-mail address removed) enlightened
us with...
On a page I'm offering file download links which are each targeted to an
tiny 1-pixel X 1-pixel iframe on the same page. (If you care why, see
below.) Under certain conditions, I want to popup a window which is NOT
constrained within the iframe to which its creator page is targeted. But
since the download page is being targeted to the tiny iframe on the
application page, any popups or alerts I've tried creating from the download
page's code do not appear, presumably because they're being created inside
the "invisible" iframe.

Don't know if this works, since I am a bit pressed for time and don't
have time to test it.
Give it a shot...

if (whatever error you want to catch)
{
opener.alert("error");
}

It may depend on domains and permissions and such, but it sounds like
all the pages are yours, so...

-------------------------------------------------
~kaeli~
Jesus saves, Allah protects, and Cthulhu
thinks you'd make a nice sandwich.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top