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);
Biki
  • 2,518
  • 8
  • 39
  • 53

1 Answers1

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

Community
  • 1
  • 1
Jonathan M
  • 17,145
  • 9
  • 58
  • 91