By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,548 Members | 1,162 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,548 IT Pros & Developers. It's quick & easy.

javascript parsing HTML from XML

P: 2
Hi all,

I have a XML file that among other things has the following node.
As you can see it contains HTML tags.
I want to append content of "page" tag into my html document.

Expand|Select|Wrap|Line Numbers
  1. <?xml version=""1.0"" encoding=""utf-8"" ?>
  2. <root>
  3. <page>
  4. <div class='clk'>
  5. <a href='...'>1</a>
  6. <a href='...'>2</a>
  7. <a href='...'>3</a>
  8. <a href='...'>4</a>
  9. .
  10. .
  11. .
  12. </div>
  13. </page>
  14. </root>
With javascript, in Mozilla, I easily retrieve the content of the
XML "page" tag using the following line of code

var myHtml= xmlDoc.getElementsByTagName('paging')[0].innerHTML;

but in chrome and ie and other browser
do not work, resulting in myHTML being undefined.

Thanks for your help.
Nov 12 '13 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 8,639
since innerHTML is not part of any effective standard, you can try the workaround presented on MDN.
Nov 12 '13 #2

Post your reply

Sign in to post your reply or Sign up for a free account.