views:

214

answers:

1

Hello,

I am using Google Docs in my project using its API.

I am loading docs in modal window iframe using http://fancybox.net/ a jquery plugin

It works fine but when in Google Docs Save and Close button is press, it closes the iframe and redirects the current page to Google Docs, So is there any way I can prevent the redirection to Google Docs and just close the modal window?

Thank You.

A: 

There are a few other questions i've found on SO that deal with this type of question;

http://stackoverflow.com/questions/369498/how-to-prevent-iframe-from-redirecting-top-level-window

http://stackoverflow.com/questions/369498/how-to-prevent-iframe-from-redirecting-top-level-window

Basically it involves using the 'window.onbeforeunload' function to kill the iframe if it attempts to redirect.

Jared Forsyth