Scripted iFrame loads contents over current page instead of within an iFrame

Posted by HidingInABunker on Stack Overflow See other posts from Stack Overflow or by HidingInABunker
Published on 2010-03-30T22:56:02Z Indexed on 2010/03/30 23:03 UTC
Read the original article Hit count: 867

Filed under:
|
|
|

I'm trying to load a webpage into an iFrame while keeping a content bar on top, but for some pages that I try to load into the iFrame the contents is loaded as if I navigated to that page.

I use the following code to dynamically load an iframe:

$('#my_iFrame').attr("src","http://www.nytimes.com/2010/03/26/opinion/26ryan.html");

It looks like there is a script on these pages that checks to see if it is being loaded into an iframe and changes the document.location to it's own url if so.

Is there any way around a hack like this so that I can load that site into an iFrame? Maybe some way to protect the value of window.location?

© Stack Overflow or respective owner

Related posts about html

Related posts about JavaScript