Solved

About blank iframe not running embedded javascript called from XHR

Posted on 2012-03-16
3
173 Views
Last Modified: 2013-11-21
We have developed some Javascript that gets some content from a website using XHR and then writes to a new document (about:blank) within an iframe.

If the page contains embedded Javascript it’s not executed – it is not executed if its “in line” but it can execute if it’s called from a downloaded include.

In addition even though we set the base ref tag the “onpage “ links ie do not work and are interpreted as being on a different page (which is then attempted to be loaded).

Our app is designed to run on HTML5 as such an HTML 5 only solution would work for us
0
Comment
Question by:gregor2
3 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 500 total points
ID: 37732054
iframe comply to the same origin policy, hence it must load all necessary javascript itself
or your page in the iframe needs explicitely set the domain attribute to its parent (which works in some browsers)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
JavaScript export function not working in IE 15 37
Angular - break the dataset in chunks? 7 39
How can I echo a PHP variable in AJAX function? 7 35
Change javascript css 1 20
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now