0

I ve a JS array, comprising multiple JS objects. I want to convert JS array to JSON type, & pass that to controller (using AJAX - POST call). So that I can retrieve the values from the Array of Objects, in my controller & save them in DB.

NB: I ve tried using $.stringify(myArry), but its not able to send data to controller in JSON format. Also I cant use $.toJSON(myArray), as I m not allowed to include a new plugin in our solution. :(

Plz suggest me any other idea.

Else if anyone can let me know how to deserelize the array in cotroller, that I ve sent by using $.stringify(myArry), that would also great. Something like

var result = JavaScriptConvert.DeserializeObject(inputContent, JsonDataType);

1 Answer 1

1

Per this post, it looks like you'll have to add another plug-in:

JSON stringify missing from jQuery 1.4.1?

The Google solution looks good: http://code.google.com/p/jquery-json/

Or just use the JSON object from Crockford: https://github.com/douglascrockford/JSON-js

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.