Response title
This is preview!
<?xml version="1.0" encoding="ISO-8859-1"?>
<pics>
<pic>
<autor>rtteewt</autor>
<desc>trhtrhtreherhetrhhrh</desc>
</pic>
<pic>
<autor>tewtewt</autor>
<desc>hytjyujryukukyyu.</desc>
</pic>
<pic>
<autor>5yutru</autor>
<desc>fghgyhvehtyudyd</desc>
</pic>
<pic>
<autor>jhgjgfj</autor>
<desc>trhythtrjtikui</desc>
</pic>
</pics>
var total = 0;
function readXML(section)
var xml = $.ajax(
{
type: "GET",
url : "xmldocs/picslist.xml",
dataType: "xml",
success: function(xml)
{
total = xml.getElementsByTagName("pic").length;
}
});
alert(total);
}
var total = 0;
function readXML(section) {
$.ajax(
{
type: "GET",
url : "xmldocs/picslist.xml",
dataType: "xml",
success: function(xml)
{
total = xml.getElementsByTagName("pic").length;
alert(total); // here
}
});
// alert(total); not here !!!
}
© 2013 jQuery Foundation
Sponsored by and others.