Convert array to JSON
Script for backward-compatibility: https://github.com/douglascrockford/JSON-js/blob/master/json2.js And call: Note: The JSON object is now part of most modern web browsers (IE 8 & above). See caniuse for full listing. Credit goes to: @Spudley for his comment below