ajax传递的参数中有单引号

前端之家收集整理的这篇文章主要介绍了ajax传递的参数中有单引号前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

var driverName = (“#txtDriverName”).val().replace(“’”,“””);
varphone=
(“#txtPhone”).val().replace(“’”,“””);
var carNo = (“#txtCarNo”).val().replace(“’”,“””);.ajax({ type: “Post”,url: “DriverLocationMap.aspx/GetDataBind”,async: false,contentType: “application/json; charset=utf-8”,dataType: “json”,data: “{routeId:’”+ routeId + “’,currentCity:’” + currentCity + “’,driverName:\”” + driverName + “\”,phone:\”” + phone + “\”,carNo:\”” + carNo + “\”}”,success: function(data) { jsonStr=JSON.parse(data.d); } });

猜你在找的Ajax相关文章