weixin_33726313 2011-06-01 09:55 采纳率: 0%
浏览 80

发送ajax请求时出现问题

My problem is I got 2 link call the same function, but in first link I can see ajax request in firebug(run fine) but in second query, my ajax totally won't show in firebug(request won sent out) and alert me 0,error,undefined.

However I already try both of my link, its valid and can be surf.

HTML

<a onclick="friend_act(url3)">test</a>
<a onclick="friend_act(url4)">test2</a>

JS

function friend_act(url2){
$.ajax({
   type: 'POST',
   url:url2,
   data: {ao:1,msg:1},
   dataType: 'json',
   beforeSend: ShowLoading,
   success: function(resp){
       $('#theLoading').dialog('close');
       $('#loading').html('');
       //add friend

   },
    error:function(xhr, ajaxOptions, thrownError){
       alert(xhr.status);
        alert(ajaxOptions);
                alert(thrownError);
       $('#theLoading').dialog('close');
       $('#loading').html('');
    }
 });
}
  • 写回答

2条回答 默认 最新

  • 狐狸.fox 2011-06-01 10:12
    关注

    i simplified your problem. here is a working example. Maybe this can get you goiing..

    http://jsfiddle.net/SjE7f/

    评论

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?