Solved

About blank iframe not running embedded javascript called from XHR

Posted on 2012-03-16
3
172 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

706 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

15 Experts available now in Live!

Get 1:1 Help Now