jquery Ajax调用导致Firefox 18.0.1中的Undefined Error

时间:2013-02-06 12:46:18

标签: jquery asp.net ajax vb.net

$(“#btnLogin”)。click(function(){

          if (order != "undefined")
              $.ajax(
                 {
                     type: "POST",
                     data: "{'NewOrder': '" + order + "'}",
                     url: "imgpost.aspx/Update",
                     dataType: "json",
                     contentType: "application/json",
                     processdata: true,
                     beforeSend: function (xhr, data) {
                         console.log(data);
                         alert(data);
                     },
                     success: function (msg) {
                     },
                     error: function (XMLHttpRequest, textStatus, errorThrown) {
                         alert("Error Occured!" + " | " + XMLHttpRequest + " | " + textStatus + " | " + errorThrown);

                     }
               });
      });

此处ajax调用失败,未重定向到url:“imgpost.aspx / Update”。

XMLHttpRequest和textStatus分别显示未定义和错误。

仅在mozilla 18.0.1的最新更新中出现

任何人都可以帮助我。

1 个答案:

答案 0 :(得分:0)

删除对象周围的引号。

data: {NewOrder: order},