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

Help with Javascript XML in FF

P: 3
I have this code:

Expand|Select|Wrap|Line Numbers
  1. doc = document.implementation.createDocument("", "", null);
  2.                             doc.async = false;
  3. doc.load("<% this.Response.Write(this.cmd);%>");
  4.  
  5.    var xpe = new XPathEvaluator();
  6.    var result = xpe.evaluate ("menu", doc, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
  7.  
result.singleNodeValue returns null!!! This works great in IE (the equivalent code) but not in FF.

Any help is greatly appreciated.
Nov 12 '07 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
Try this onload, i.e. put the XPath stuff in a function and call it when the XML document has loaded.
Nov 13 '07 #2

P: 3
Thanks for the reply. I tried that and I get the same result (a null value).

Thanks
Nov 13 '07 #3

acoder
Expert Mod 15k+
P: 16,027
Hmm... there doesn't seem to be anything wrong.

Does this only happen with FIRST_ORDERED_NODE_TYPE?
Nov 14 '07 #4

Post your reply

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