Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Firefox Save As Questions

Status
Not open for further replies.

korndog21

Programmer
Dec 13, 2010
2
US
Regarding the solution provided by tsuji at is possible to run the JavaScript from the main browser window (that contains HTML and JavaScript) in order to prompt the user to save the contents of a child iframe window (containing XML)? The JavaScript doesn't really belong within the XML file itself.

Thanks in advance! :)

-Vince
 
If the iframe is loaded from the same doamin (or subdomain thereof), I'd say "give it a try and find out".

If it is not, then I'd say "no, due to security restrictions".

If the former and you want to give it a go, here's a good cross-browser way of getting hold of the document element inside an iframe:

Code:
iframeDoc = iframe.contentDocument || iframe.contentWindow.document;

Hope this helps,

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Snippets & Info:
The Out Atheism Campaign
 
Where would I plug in that "iframeDoc" handle into the existing code? Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top