在观察中的AJAX错误 [英] AJAX ERROR IN JQUERY

查看:36
本文介绍了在观察中的AJAX错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此错误..



无法将类型为\\\'System.String \ u0027的对象转换为\\\'System.Collections.Generic.IDictionary类型2 [System.String,System.Object] \ u0027,StackTrace:







如何在.js文件中解决这个问题

i m getting this error ..

Cannot convert object of type \u0027System.String\u0027 to type \u0027System.Collections.Generic.IDictionary`2[System.String,System.Object]\u0027","StackTrace":"



how to solve this in .js file

推荐答案

试试这个:



Try this :


.ajax({
url:' webservices / LeadManagement.asmx / UpdateLeadmanage'
类型: POST
dataType:' json'
cache: false
contentType:' application / json; charset = utf- 8'
数据: {'leadId': + leadid + ,'inquiry':' + inquiry + ','desc':' + desc + ','category':' + category + '}
成功: function (结果){
alert(result.d) ;
},
错误: function (错误){alert(' 错误); }
});
.ajax({ url: 'webservices/LeadManagement.asmx/UpdateLeadmanage', type: "POST", dataType: 'json', cache: false, contentType: 'application/json; charset=utf-8', data: "{'leadId':"+ leadid +",'enquiry':'"+enquiry+"','desc':'"+desc+"','category':'"+category+"'}", success: function (result) { alert(result.d); }, error: function(err){ alert('error'); } });


亲爱的,



替换下面的行



旧:

数据:JSON.stringify(sdata),

sdata + =leadId:'+ leadid +',;





数据:sdata,

sdata + =leadId: + leadid +,;
Dear,

Replace below line

Old :
data: JSON.stringify(sdata),
sdata += "leadId:'" + leadid + "',";

NEW
data: sdata,
sdata += "leadId:" + leadid + ",";


这篇关于在观察中的AJAX错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆