Solved

Reading XML from an Iframe

Posted on 2009-05-13
3
544 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
  • 2
3 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 500 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
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 24375089
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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
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.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

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

18 Experts available now in Live!

Get 1:1 Help Now