不善言辞-不行于色 2016-05-04 09:36 采纳率: 100%
浏览 2359
已采纳

求大神,关于js $.get()的用法

$(document).ready(function() {
$.get('/Index/checkdo/id/{$id}',function(ret){
retime_flag = 0;
$('#time').html('');
if(ret == 'movesay'){
$('#msg').html('OK 检查通过,跳转中...');
if(returnurl){
setTimeout(function() {
window.location.href= returnurl;
},1000);
}else{
setTimeout(function() {
window.location.href= '/';
},1000);
}
}else{
$('#load_img').hide();
$('#msg').html('检查未通过!!!');
}
});
});

  • 写回答

5条回答 默认 最新

  • Lee_Y_K 2016-05-04 09:42
    关注

    完整的四个参数.
    $.get([地址] , [请求参数,get 方法是queryString] , [回调方法, function(结果参数){ }] , [响应类型, json, text 等, 不正确的类型不会执行回调方法, 可不填写默认text])

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?