Script for backward-compatibility: https://github.com/douglascrockford/JSON-js/blob/master/json2.js
And call:
var myJsonString = JSON.stringify(yourArray);
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
Related Posts:
- Complex JSON nesting of objects and arrays
- How to filter an array/object by checking multiple values
- Nested JSON objects – do I have to use arrays for everything?
- How to find the sum of an array of numbers
- Uncaught TypeError: Cannot read property ‘length’ of undefined
- How to compare arrays in JavaScript?
- Failed to load resource: net::ERR_FILE_NOT_FOUND loading json.js
- jQuery AJAX cross domain
- Loading local JSON file
- Uncaught TypeError: data.push is not a function
- How to convert selected HTML to Json?
- How do you put an image file in a json object?
- push object into array
- How to add an object to an array
- How to change value of object which is inside an array using JavaScript or jQuery?
- SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
- Uncaught TypeError: Cannot read property ‘toUpperCase’ of undefined
- SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
- How to display raw JSON data on a HTML page
- How to filter JSON Data in JavaScript or jQuery?
- How to add a button dynamically using jquery
- Uncaught SyntaxError: Unexpected token with JSON.parse
- How can JavaScript save to a local file?
- Defining a HTML template to append using JQuery
- Remove escape characters from JSON string pulled from a database
- For-each over an array in JavaScript
- How do I redirect to another webpage?
- What is JSONP, and why was it created?
- Cannot read property ‘push’ of undefined when combining arrays
- How can I remove a specific item from an array?
- How to deal with net::ERR_SSL_PROTOCOL_ERROR?
- What is the way of declaring an array in JavaScript?
- Remove duplicate values from JS array [duplicate]
- How to read an external local JSON file in JavaScript?
- How to loop through an array containing objects and access their properties
- SyntaxError: Unexpected token o in JSON at position 1
- Remove duplicate values from JS array
- Check if checkbox is checked with jQuery
- Getting Error “Form submission canceled because the form is not connected”
- How to check if array is empty or does not exist?
- How can jQuery deferred be used?
- Uncaught TypeError : cannot read property ‘replace’ of undefined In Grid
- Disable/enable an input with jQuery?
- What does on() in JavaScript do?
- Use images like checkboxes
- JavaScript error (Uncaught SyntaxError: Unexpected end of input)
- How to print elements from array with javascript
- ChangeDate – Date Picker Bootstrap
- Uncaught TypeError: Cannot read property ‘msie’ of undefined
- How to hide a div with jQuery?v
- How do I set/unset a cookie with jQuery?
- How to loop through an array containing objects and access their properties
- Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH
- With jQuery, how do I capitalize the first letter of a text field while the user is still editing that field?
- Convert Array to Object
- How to update array value javascript?
- Counting the occurrences / frequency of array elements
- TypeError: $(…).DataTable is not a function
- jQuery explode string like PHP
- Validate date in dd/mm/yyyy format using JQuery Validate
- Simulate Keypress With jQuery
- react router v^4.0.0 Uncaught TypeError: Cannot read property ‘location’ of undefined
- Adding options to a
- jQuery Ajax POST example with PHP
- Setting and getting localStorage with jQuery
- Showing an image from an array of images – Javascript
- Javascript isnull
- Set value to currency in
- HTML Entity Decode
- jquery beforeunload when closing (not leaving) the page?
- Array Mapping in AngularJs
- How do I pass the this context to a function?
- is there something like isset of php in javascript/jQuery?
- jQuery – Dynamically Create Button and Attach Event Handler
- Highlight a word with jQuery
- Error: TypeError: $(…).dialog is not a function
- getContext is not a function
- How to change the text of a label?
- How to check ‘undefined’ value in jQuery
- navigator.geolocation.getCurrentPosition sometimes works sometimes doesn’t
- How should I initialize jQuery?
- How to reload page every 5 seconds?
- How do I handle newlines in JSON?
- Fire oninput event with jQuery
- “NS_ERROR_DOM_BAD_URI: Access to restricted URI denied”
- How to set “style=display:none;” using jQuery’s attr method?
- Change the selected value of a drop-down list with jQuery
- How to dequeue a script?
- How to use wp_localize_script in custom page template?
- Dynamically insert values in a WordPress SelectControl Options field
- AngularJS with route and JSON API
- List of JS Events for Widgets?
- JQuery not loading
- Uncaught ReferenceError: jQuery is not defined – although jQuery is loaded [closed]
- Uncaught TypeError: jQuery(…).slider is not a function
- Parse wordpress blog data using json api and ajax
- Putting custom html/js page into Elementor as it’s own block
- “jQuery Not Defined” Error When Connecting to PayPal
- Open image gallery on link click
- Gutenberg core/file add style support in js/ json