$("#loadingImg").hide();
$("#text").hide();
$("#clickMe").click(function(){
$("#text").hide();
$("#loadingImg").show();
var strImg, strText;
$("#loadingimg").show();
var objXml = $.get("loadme.xml", function(xml){
strText = $("text",xml).text();
$("#text").html(strText);
//alert(strText);
strImg = $("img",xml).text();
$("#text").append("<img src="" "+strImg+"\" />");
$("#text").fadeIn();
$("#loadingImg").hide();
}); //end load xml
}); //end click
});//end onload
$(document).ready(function(){
$("#loadingimg").hide();
$("#text").hide();
function
loadXml(strPathToXml) {var _objXml;
$("#loadingimg").show();
var objXml = $.get(strPathToXml, function(xml){
_objXml = xml;
//alert("xmlLoad: " + $("text",xml).text());
});
$("#loadingimg").hide();
return _objXml;
} //end loadXML
$("#clickMe").click(function(){
//hide if the link is going to be clicked more than once.
$("#text").hide();
//load xml
var objXml2, strText, strImg;
objXml2 = loadXml("loadme.xml");
//get text from xml and put it in the html
strText = $("text",objXml2).text();
$("#text").html(strText);
//get the image and put it behind the text
strImg = $("img",objXml2).text();
//alert("click: "+ strText);
$("#text").append("<img src="" "+strImg+"\" />");
//at last show the div#text
$("#text").show();
}); //end click
});//onready
Jaime Martinez
P.S. 2 The is a zip if you want to test it local, but remember to start the webserver ;)
_______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/