views:

63

answers:

2

Possible Duplicate:
jQuery: How to stop AJAX function escaping JSON string used to POST data

I make a jQUERY ajax call to send and save to data.When I send Google's Dog string, I receive Google\'s Dog . What is the reason of this . And what is the best way yo avoid this. I do not want to use stripslashes function because this removes all backslashes

$.ajax({
            type: "POST",
            url: 'http://example.com/api/save',
            data: {
                data:userArray,
            },
            dataType: 'json',
            success: function(response){

            }
        });

userArray is an array which has user's information

+1  A: 

Those slashes are escaping the special characters. Basically its telling javascript to treat that character as a normal string character instead of something 'special'. Click the link for more examples.

HurnsMobile
A: 

Already answered. http://stackoverflow.com/questions/1565887/jquery-how-to-stop-ajax-function-escaping-json-string-used-to-post-data

Capt Otis
What is the answer ?.If my question is already answered please comment it. Do not write link as a answer.
Oguz
You now have 2 posts with the answer in a link, Capt Otis gave you a perfectly good answer, and I am frustrated by your response.
Please use comments on the question to indicate duplicates, not answers.
Roger Pate