Monday 15 June 2015

JavaScript / jQuery version of PHP's serialize() function -


I search for the most up-to-date methods to sort an array of data in javascript (w / or w) I'm doing / o jQuery). Using the latest version of Chrome browser (June 2013)

Using simple associative array, PHP serialize ().

  array ('product_id' = & gt; "145549", "field" => gt; "value")   

-

  a: 2: {s: 10: "product_id"; 6: "145549"; S: 5: "field"; S: 5: "price";}   

If there is no easy way to use the same serial string Javascript, what is the jjson_encode () of PHP?

What did Moses say in a comment? Most modern browsers supply JSN objects, you can use object detection to see whether it is available. No one is necessary, even if you do not have it in the browser, you can supply it yourself

Basic Support: Even there are some good code examples.

No comments:

Post a Comment