Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 11919

JSON (JavaScript Object Notation) aka the Fat Free Alternative to XML is a lightweight data exchange format inspired by JavaScript object literals. It is often used with JavaScript, Ajax, and RESTful web services but is completely language independent.

2 votes

Array of Objects or Array of arrays?

The second approach is the best way to go here. That's because if you think about it, your app needs data that is "A list of contacts". If my OOP concepts aren't rusty, contacts would equate to an o …
Joseph's user avatar
  • 25.2k
3 votes

Scraping reviews from Google Play using JavaScript

Use scraping as last resort. I suggest you find available APIs for that. It's more robust, and easy to work with. One issue with scraping is that it fetches the static HTML generated by the url. You …
Joseph's user avatar
  • 25.2k
1 vote
Accepted

Create a separate JSON + syntax

I would recommend removing count if all it does is represent the number of items in movies. Otherwise, you'll have 2 sources of truth in the data (count and the length of movies) and code that takes s …
Joseph's user avatar
  • 25.2k
3 votes
Accepted

Listing with JSON or plain HTML

Now, as you said, you can do JSON, and your other approach seems to be right: Form <form> <h3>Advantages</h3> <button>Add</button> // get nextAll advantages, find the last and append after <input …
Joseph's user avatar
  • 25.2k
2 votes

Restructuring data received from JSON call

A much more maintainable solution would be using templates, like Handlebars. This is to primarily avoid HTML in the JS, which can get messy in the long run: Assuming your data looks like: { media …
Joseph's user avatar
  • 25.2k
2 votes

Javascript Stringify Nested Objects with Loop References

It's the same reason why JSON is preferred over XML for AJAX, because JSON is a data exchange format while XML is a document format. …
Joseph's user avatar
  • 25.2k
3 votes

A simple BSON indenter / compacter

the goal of this code is not to check if a document has a valid BSON syntax But that's the first requirement of a formatter, understanding the syntax. For any formatter to work, it must understan …
Joseph's user avatar
  • 25.2k
1 vote
Accepted

Get real time geojson on Javascript

First of all, readyState 4 simply means XHR is done. The response, however, can still either be a success (2xx) or a failure (4xx, 5xx). In order to distinguish a success from an error, you should als …
Joseph's user avatar
  • 25.2k
5 votes
Accepted

Checking for an undefined nested variable in a JS object

Here's an exotic (and costly) one: if(((json || {}).data || {}).formkeys ! …
Joseph's user avatar
  • 25.2k
1 vote

Concatenating multiple strings from a JSON response

$.post('/API',null,'json').then(function(response){ location = Object.keys(response.data).map(function(key){ return response.data[key]; }).join(', '); }, function(){ location = previousLocation …
Joseph's user avatar
  • 25.2k
2 votes
Accepted

Join JSON objects on common property

I notice a query on one of your urls. I suggest you use jQuery's $.param to construct the query cleanly. For your first loop, you could use reduce instead of forEach to generate your hash. Additional …
Joseph's user avatar
  • 25.2k
3 votes
Accepted

React & ES6 news app

Ok, looks like a neatly written React. Let's see what I can do. <div className="main-content col-sm-12"> <div className="left-sided-lg-top-otherwise col-lg-8 col-md-12 col-sm-12 co …
Joseph's user avatar
  • 25.2k
1 vote
Accepted

Collect several API call results

I suppose this code is used like: var twitch = new Twitch(); twitch.update(function(){ // called each time a site responds }); A few things: First, I see little benefit of this functionality bei …
Joseph's user avatar
  • 25.2k
3 votes

JSON encoder/decoder for bandwidth efficiency

First, you aren't really getting this for free. You are trading space (bandwidth) for processing, as well as adding complexity to both sending and receiving end. Additionally, your data isn't just "da …
Joseph's user avatar
  • 25.2k
1 vote

Speed up loop through JSON

Ok, let's first go through your code $('.uiGridContent tbody').html(''); This is bad because this doesn't remove handlers and other objects bound to the elements. It's not good housekeeping per se …
Joseph's user avatar
  • 25.2k

15 30 50 per page