, . -, $temp_id , :
$.ajax({
……
success:function(){
var $temp_id;
for (var i = 0; i < $children.length; i++) {
$temp_id = $children.eq(i).attr("id");
-, , $temp_id "id-1" , "id-2" , , , "id-2".
:
2010-12-03:
$.ajax({
……
success:function(){
for (var i = 0; i < $children.length; i++) {
var $temp_id = $children.eq(i).attr("id");
$.ajax({
type: "get",
url: "Database/App_all.xml",
dataType: "html",
success: function($tid) {
return function (xml) {
var $temp_code = $(xml).find("app[id='" + $tid + "']").find("html_code").html();
$($temp_code).appendTo($("#contain")).hide().show('slow');
}
}($temp_id),
error: function () { }
});
}
}
});
, , $temp_id , , . $tid , , $temp_id .
: hh54188
"alert" ajax. IE Firefox. , , . , :
for (var i = 0; i < 2; i++) {
console.log('loop: ' + i);
$.ajax({
url: "Database/App_all.xml",
dataType: "html",
success: function () {
console.log('callback');
}
});
}
, :
loop: 0
: 1
callback
callback
. Firefox IE , :
loop: 0
callback
: 1
callback
. . "" JavaScript, . - "" . console.log(). console.log() IE 8+. IE DOM.