Possibly odd question; I'm trying to load an XML into jQuery to traverse it.
Using $.post I can do this perfectly, and specify XML as the dataType. My question revolves around how I can get jQuery to use that dataType to understand the same data if it is already in the page, i.e. I have it in a variable.
Whenever I use exactly the same XML data in a variable it can't traverse it properly.
I've tried taking out the declaration and removing question marks, escaping quotes etc.
I've tried loading like:-
var xml = new XML('<blah><moo>134</moo></blah>');
and of course
var xml = $('<blah><moo>134</moo></blah>');
and
var xml = '<blah><moo>134</moo></blah>';
and
var xml = "<blah><moo>134</moo></blah>";
etc. What am I doing wrong?