Solved

About blank iframe not running embedded javascript called from XHR

Posted on 2012-03-16
3
181 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

734 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