Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hi All,

I am using a JavaScript Function() to generate a JSON response like in the below.

JavaScript
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);

                   }
               });
       }

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
Posted
Comments
Sinisa Hajnal 17-Oct-14 6:15am    
Why would you first stringify then correct then again reconvert? Why not work on the original data?

Also, why can't you google string manipulation in javascript? There are tons of examples lying around.
Chiranthaka Sampath 17-Oct-14 6:40am    
After I stringify the JSON I sow that there are some unwanted XML statements generating. So it generates no of problems. Because of that I want to remove that XML and get the JSON response without that. So that is what I really want to know.
Sinisa Hajnal 17-Oct-14 7:01am    
OK. And again the question why can't you just google string manipulation routines instead of expecting someone to provide the code for you.
Chiranthaka Sampath 17-Oct-14 7:12am    
Ok then I will look at it again. Anyway thanks pal.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900