I am using dynarch calendar and I want the selected dates ranges to be converted into strings like as firefox’s toSource() do.
Example of converting an two-dimensional array into source:
[20110917, [20110920, 20110922], 20110923, [20110925, 20110926]]
any alternative to get this same output in other browsers too..???
I am already using jQuery 1.6.2 library.
So, I don’t want any other library or bigger script to get this function to work.
You tagged it json already, modern browsers support the
JSON.stringifyandJSON.parsemethods for converting data to text (JSON representation) and text to data respectively.In your case:
Alternative method: