将JSON响应传递给JavaScript字符串变量并删除不需要的字符。 [英] Passing JSON response to a JavaScript String Variable and Removing unwanted characters.
问题描述
大家好,
我正在使用JavaScript函数()生成如下所示的JSON响应。
Hi All,
I am using a JavaScript Function() to generate a JSON response like in the below.
function setJsonSer() {
formData = {
'Email': 'clientlink@russell.com',
'Password': 'russell1234',
'URL': getVaria()
};
$.ajax({
url: "/APIWebService.asmx/AnalyticsDataShowWithPost",
type: 'POST',
data: formData,
complete: function(data) {
JSON.stringify(data);
alert("This is Set JSON In
"+JSON.stringify(data));
//document.write(JSON.stringify(data));
Load(data);
}
});
}
我想将此JSON响应传递给String JavaScript变量。在这个变量中,我需要搜索一组特定的字符并从一个字符开始
并删除它们。然后,必须将该变量值重新转换为JSON响应。这是否可以使用
JavaScript?
有人能帮忙解决这个问题吗?< br $>
谢谢和问候,
Chiranthaka
I want to pass this JSON response to a String JavaScript variable. Within this variable I need to search a particular set of characters and starting
from one character and to remove them. Then that variable value must be reconverted to the JSON response. Will this be possible to reach using
JavaScript?
Could someone helpme to solve this matter?
Thanks and regards,
Chiranthaka
推荐答案
.ajax({
url: / APIWebService.asmx / AnalyticsDataShowWithPost,
type:' POST',
data:formData,
complete: function (data){
JSON .stringify(data);
alert( 这是在
中设置JSON + JSON.stringify(data));
// document.write(JSON.strin gify(data));
加载(数据);
}
});
}
.ajax({ url: "/APIWebService.asmx/AnalyticsDataShowWithPost", type: 'POST', data: formData, complete: function(data) { JSON.stringify(data); alert("This is Set JSON In "+JSON.stringify(data)); //document.write(JSON.stringify(data)); Load(data); } }); }
我想将此JSON响应传递给String JavaScript变量。在这个变量中,我需要搜索一组特定的字符并从一个字符开始
并删除它们。然后,必须将该变量值重新转换为JSON响应。这是否可以使用
JavaScript?
有人能帮忙解决这个问题吗?< br $>
谢谢和问候,
Chiranthaka
I want to pass this JSON response to a String JavaScript variable. Within this variable I need to search a particular set of characters and starting
from one character and to remove them. Then that variable value must be reconverted to the JSON response. Will this be possible to reach using
JavaScript?
Could someone helpme to solve this matter?
Thanks and regards,
Chiranthaka
这篇关于将JSON响应传递给JavaScript字符串变量并删除不需要的字符。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!