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

Facing a Problem when I use the loadXML("<xml String>")

P: 1
Hi everyone,

This is my first post to this forum, hope I would get a reply quickly :-)

Iam using loadXML(xmlString) and it is always returning "false". My code looks like this :

Expand|Select|Wrap|Line Numbers
  1. if (window.ActiveXObject)
  2.         {
  3.          var responseXml=new ActiveXObject("Microsoft.XMLDOM"); 
  4.         responseXml.async="false";
  5.         var wellFormedMarkup = "<g>"+string+"</g>";
  6.          alert(wellFormedMarkup);
  7.          //alert(responseXml.loadXML(wellFormedMarkup));
  8.             loaded = responseXml.loadXML(wellFormedMarkup);
  9.             alert(loaded);
  11. .......
  13. }
when I print the value for the *string*, it displays the response text.
So its not null or empty.
Where did I get deviated???
Thank You in advance.

Jun 11 '08 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 15k+
P: 16,027
Welcome to Bytes!

See if this example works for you. Remember that other browsers have a different method of reading/loading XML files/strings.

PS. please remember to use code tags when posting code. Thanks!
Jun 11 '08 #2

Post your reply

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