Skip to content
Advertisement

Tag: json

How to save the output of a console.log(object) to a file?

I tried using JSON.stringify(object), but it doesn’t go down on the whole structure and hierarchy. On the other hand console.log(object) does that but I cannot save it. In the console.log output I can expand one by one all the children and select and copy/paste but the structure is to big for that. Answer Update: You can now just right click

How to stringify event object?

JSON.stringify(eventObject); gives: TypeError: Converting circular structure to JSON dojox.json.ref.toJson(eventObject); gives: TypeError: Accessing selectionEnd on an input element that cannot have a selection. Is there some library/code ready to use to accomplish it ? Answer You won’t be able to serialize an event object with JSON.stringify, because an event object contains references to DOM nodes, and the DOM has circular references

What is the “right” JSON date format?

I’ve seen so many different standards for the JSON date format: Which one is the right one? Or best? Is there any sort of standard on this? Answer JSON itself does not specify how dates should be represented, but JavaScript does. You should use the format emitted by Date’s toJSON method: 2012-04-23T18:25:43.511Z Here’s why: It’s human readable but also succinct

Ways to save Backbone.js model data?

I am more into front end development and have recently started exploring Backbone.js into my app. I want to persist the model data to the server. Could you please explain me the various way to save the Model data (using json format). I am using Java on server side. Also I have mainly seen REST being used to save data.

How to create HTML select option from JSON hash?

I have a simple JSON code: I have a select tag in my HTML: I need a simple way to create HTML select box from this JSON, like this: Answer Just for kicks here is an answer in pure javascript, also you probably do not need an array for this just a simple object will suffice

How to convert JSON to CSV format and store in a variable

I have a link that opens up JSON data in the browser, but unfortunately I have no clue how to read it. Is there a way to convert this data using JavaScript in CSV format and save it in JavaScript file? The data looks like: The closest I could find was: Convert JSON format to CSV format for MS Excel

Advertisement