开发者

Error in processing ajax jquery

开发者 https://www.devze.com 2023-03-19 13:40 出处:网络
is giving an error that can not capture with firebug, I wonder what\'s wrong with this code? var obj = {}; obj.registry= $(\"#ctl00_ContentPlaceHolder1_TextBox3\").val();

is giving an error that can not capture with firebug, I wonder what's wrong with this code?

var obj = {}; obj.registry= $("#ctl00_ContentPlaceHolder1_TextBox3").val();
    $.ajax({
        type: "POST",
        url: "Page.aspx/PatientCheck",
        data: JSON.stringify(obj.toString()),
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function(msg)
开发者_如何学Go        {
            isErrror= true;
        },
        error: function()
        {

        }
    });

this code is to validate that there are already a patient with the same code, so the validator.


either

data: {str: JSON.stringify(obj)}

or

data: obj


Change this line:

data: JSON.stringify(obj.toString()),

To this:

data: JSON.stringify(obj),
0

精彩评论

暂无评论...
验证码 换一张
取 消