Hi… As a beginner i was very pleased with myself for figuring out how to convert an xml file to a string, using a couple tutorials and a little creativity The script pulls the first instance of an image’s url from the cdata section, and changes an image on my page…
then I tried it in IE 9. Damn. What should be done to the script below to make it function in internet Explorer 8 or 9?
(I also found that on my droid I got an xml error)
[CODE]<script>
$.ajax({
url: ‘http://www.website.com/folder/rss.xml’,
type: ‘GET’,
dataType: ‘text’,
timeout: 1000,
error: function(){
alert(‘Error loading XML document’);
},
success: function(xml){
var mySplitResult = xml.split(“img src=”);
var test = xml.search(“img src=”)+9;
var test2 = xml.search(“.jpg”)+4;
var cutout = xml.slice(test,test2);
document.image1.src=cutout;
}
});
</script>
<img src=”/storage/images/placeholder_mug.gif” id=”image1″ onload=”” />