按照qq_天霸動霸tuo_0說的那樣做之后就可以了,我也不知道為什么,由于是第一次學習ajax,對于服務器方面也是不清楚,首先五行以及服務器文件http后加s,我覺得可能是由于服務器方面的問題造成的。不止src中的http后面加個s,在服務器文件http后面也記得了,各位老鐵,小心坑了!
2018-04-13
var js = [{"name":"Tom","sex":"man","score":"80"},{"name":"Jerry","sex":"man","score":"92"}];
$.each(js,function(index,student){
$("ul").append("<li>"+"姓名:"+student["name"]+" 性別:"+student["sex"]+" 成績:"+student["score"]);
});
$.each(js,function(index,student){
$("ul").append("<li>"+"姓名:"+student["name"]+" 性別:"+student["sex"]+" 成績:"+student["score"]);
});
將源碼(http://www.xianlaiwan.cn/data/jquery.twoaddresult.js)中的:
if (p1 > p2) { //如果傳入的參數前者大于后者
intResult = parseInt(p1) - parseInt(p2);
}
改成
intResult = parseInt(p1) - parseInt(p2);
就能正常運行
if (p1 > p2) { //如果傳入的參數前者大于后者
intResult = parseInt(p1) - parseInt(p2);
}
改成
intResult = parseInt(p1) - parseInt(p2);
就能正常運行
2018-03-27