I have this code, loading XML documents on mouseenter, which works in Firefox:
$(document).ready(function() {
$('.invest-port-thumb a').mouseenter(function() {
$.get(this.href, function(response){
var cName = $(response).find("fragment cName");
var cind = $(response).find("fragment cName").attr("cind");
$('#slider-name .slider-copy').html(cName);
$('#slider-indu .slider-copy').html(cind);
});
});
});
and OF COURSE it doesn’t work correctly in IE. In fact, nothing loads.
Sample XML document:
<fragment>
<cName cind="Industrial" stat="Active">ABC Company</cName>
<hq>Chicago, IL</hq>
</fragment>
I found something strange, when I remove this line:
var cName = $(response).find("fragment cName");
it works fine. For some reason, I can get the attribute of the XML nodes, but not the actual nodes? Any help would be appreciated…
The line you identified:
assigns the jQuery object to the variable
cName, not it’s text content which it looks like you want. Try changing it to