Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Reading XML from an Iframe

Posted on 2009-05-13
3
Medium Priority
?
552 Views
Last Modified: 2013-11-19
I have a page with an Iframe in it. (see http://www.datacollaborative.com/qbn/map/m2.cfm) I need for a script on the main page to read the content in the iframe. One complication is that the iframe is just XML - no formatting, no XSL stylesheet. I just need to read the XML.

I could accomplish the same thing with an AJAX call, except the XML is coming from a different domain so I can't do AJAX.

I can deal with parsing the XML once I get it. I just need some way of getting it. I tried window.frames[0].document.innerHTML, and that did not work. I tried some other things too but have gotten nowhere.
<iframe height="200" width="200" src="https://www.quickbase.com/db/main?a=api_GrantedDBs" id="ifr1"></iframe>
<script>
alert(window.frames[0].document.innerHTML)
</script>

Open in new window

0
Comment
Question by:DataCollab
[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
  • 2
3 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 2000 total points
ID: 24374893
It is the "coming from another domain" which will also block you from accessing it in an iframe

read it on the server instead
0
 

Author Comment

by:DataCollab
ID: 24374993
That's unfortunate.
The problem is that I need a cookie that is on the client computer in order to access the XML. I gues that is probably considered a security breach, which is why the restriction you mentioned exists.
I am going to accept your response as the solution, but do you have any suggestions on another way for a page in domain A to read the contents of a page in domain B, when the page in domain B is only accessible with a cookie on the client computer?
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
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…
Suggested Courses

609 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