Parsing XML in IE with jQuery



I am having some trouble parsing xml with jQuery. I have a fragment of xml text and I would like to extract a certain node's value. But this isn't working in IE. It works fine in Chrome.



$(function () {
var xmlText = '<?xml version="1.0" encoding="UTF-8" ?><dog_info><keyspec><keycaps><aes /><v-clock /></keycaps><dog>';
xmlText += '<dogid>566578105</dogid><memoryinfo><access>read/write</access>';
xmlText += '<fileid>65524</fileid><size>128</size></memoryinfo></dog></keyspec></dog_info>';
alert($(xmlText).find("dogid").text()); //this do not work in ie
})

No comments:

Post a Comment