本文介绍了将JSON响应传递给JavaScript字符串变量并删除不需要的字符。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 大家好, 我正在使用JavaScript函数()生成如下所示的JSON响应。Hi All,I am using a JavaScript Function() to generate a JSON response like in the below.function setJsonSer() { formData = { 'Email': '[email protected]', '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? 有人能帮忙解决这个问题吗? 谢谢和问候, ChiranthakaI want to pass this JSON response to a String JavaScript variable. Within this variable I need to search a particular set of characters and startingfrom one character and to remove them. Then that variable value must be reconverted to the JSON response. Will this be possible to reach usingJavaScript?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? 有人能帮忙解决这个问题吗? 谢谢和问候, ChiranthakaI want to pass this JSON response to a String JavaScript variable. Within this variable I need to search a particular set of characters and startingfrom one character and to remove them. Then that variable value must be reconverted to the JSON response. Will this be possible to reach usingJavaScript?Could someone helpme to solve this matter?Thanks and regards,Chiranthaka 这篇关于将JSON响应传递给JavaScript字符串变量并删除不需要的字符。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-19 08:45