我有以下代码:
// Setup a content array for the tooltips
var Data = [];
var search = $("input#field_search").val();
var combo = $("select#search_option").val();
var jsonUrl = "ajax.php?module=formation&action=get_participant_list_json&filter_by=" + combo + "&search=" + search;
$.getJSON(jsonUrl, function(data) {
var items = [];
alert(data.join(" || " )); //WHAT TO SHOW YOU HERE
$.each(data, function(key, val) {
//alert(val);
items.push(val.replace(/@/gi, "#"));
});
//console.log(items);
//alert(items.join(" || " ));
$(".tips").each(function(i) {
$(this).simpletip({ content: items[i] });
});
});
如果我访问
ajax.php?module=formation&action=get_participant_list_json
或者
ajax.php?module=formation&action=get_participant_list_json&filter_by=&search=
直接用IE7,我按以下顺序得到好的响应数据:
["0Bequart Claire","1AZZI Sarah"]
但如果alert(data.join(" || " ));
我被逆转
0AZZI Sarah || 1Bequart Claire
你知道我的错误在哪里吗?为什么响应列表是倒序的?
谢谢你的帮助