开发者

Microsoft JScript runtime error: JSON.stringify when I pass a jobject as json to jquery

First of all to point out that I'm new with javascript and web services and i try to find out what is really going on some days now... I have got a lot of help from the related topics but I still have some questions...

in my test case i try to pass the values of var objuser. i found many examples like this but for me doesn't work.

I'm working with IE7

I get the error "Micros开发者_运维技巧oft JScript runtime error: JSON.stringify"

var objuser ={"companycode": "test1"," usercode": "test2","applicationname":"test3"};
$.ajax(
{
    type: "POST",
   url: "localhost:51136/Service2.wsdl/FindByUserAndApplication",
   contentType: "application/json; charset=utf-8",
   data:json.stringify(objuser), 
   //data: objuser, i tried this also but i got the same error 
   datatype: "json",
   success: function (msg) {
                alert(msg);
            },
    error: function(req, status, error) {
        alert(req + ", " + status + ", " + error);
    } ,
    complete: function(req, status) {
               alert(req + ", " + status);
            }

});

I have allready add the json.js ,json2.js libraries

Thank you in advance for your help!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜