Linked Questions
35 questions linked to/from Can you use a trailing comma in a JSON object?
0
votes
0
answers
84
views
I have written this code for json in python and i am getting this error "JSONDecodeError: Expecting property name enclosed in double quotes" [duplicate]
My code :
import json
a='''
{
"abc" : "2",
"phone" : {
"ss" : "22"
},
"def" : "5" ,
}'''
info =...
-5
votes
1
answer
82
views
Does the object javascript syntax right or wrong ? [duplicate]
Here it is:
var obj = {
'city': 'ny',
}
I write a comma in the end after ny
but this could run in Chrome and Firefox, but not in IE6/7
So does this kind of syntax is right or wrong or ...
27498
votes
25
answers
2.0m
views
Why is processing a sorted array faster than processing an unsorted array?
In this C++ code, sorting the data (before the timed region) makes the primary loop ~6x faster:
#include <algorithm>
#include <ctime>
#include <iostream>
int main()
{
// ...
58
votes
8
answers
35k
views
Can json.loads ignore trailing commas?
As mentioned in this StackOverflow question, you are not allowed to have any trailing commas in json. For example, this
{
"key1": "value1",
"key2": "value2"
}
is fine, but this
{
"key1": ...
18
votes
7
answers
29k
views
How to dump a collection to json file using pymongo
I am trying to dump a collection to .json file but after looking in pymongo tutorial I can not find any thing that relates to it.
Tutorial link: https://api.mongodb.com/python/current/tutorial.html
27
votes
2
answers
9k
views
Does Internet Explorer 9 choke on extra commas at the end of array and object literals?
Modern browsers and environments like Node.js allow you to say {a:1, b:2,} or [1,2,3,]. This has historically been problematic with Internet Explorer. Is this fixed in Internet Explorer 9?
32
votes
1
answer
45k
views
validating JSON from command line using `python -m jsontool` gives 'No JSON object could be decoded'
I have a data.json file that I'm validating through the command line using python's json.tool, but it keeps giving me back an error message:
$ python -m json.tool < data.json
No JSON object could ...
10
votes
4
answers
19k
views
json.loads() returns a string
Why is json.loads() returning a string? Here's is my code:
import json
d = """{
"reference": "123432",
"business_date": "2019-06-18",
"final_price": 40,
"products": [
{
...
9
votes
1
answer
12k
views
Will trailing commas break JSON?
So I've been reading up on proposed JavaScript features, and one I'm concerned about is trailing comma support in object literals and arrays.
For parameters, trailing commas don't relate here, so let'...
4
votes
3
answers
16k
views
Default Controls - How can I disable controlNav and directionNav?
I am trying to disable the controlNav and directionNav controls within flexslider. I am using the risen theme from themeforest and the theme is using jquery.flexslider-min.js. If I use the full ...
5
votes
3
answers
24k
views
Why do I get the error "unexpected end of string while parsing JSON string" when decoding a URI-encoded JSON string?
I'm trying to POST some JSON data to my Perl script, but the JSON module seems to be unable to cope with this string:
[{"":"#","jednostka":"","login":"SA"}]
I used encodeURIComponent() in JavaScript, ...
-3
votes
3
answers
5k
views
PHP + Javascript error: Unexpected token D [closed]
I have an error:
Unexpected token D
When I try to send JSON from JavaScript to PHP. I know that error is caused on server side and I tried to fix it, but then I get another errors like Unexpected ...
2
votes
2
answers
3k
views
Removing excess comma on JSON Object
Currently been working on eliminating the excess "," comma on the json object I have below.
{"rules": {
"1000": {
"action": "2",
"category": "skype",
"entity": "Private",
...
0
votes
2
answers
3k
views
Jquery JSON .each() doesnt work in Google Chrome
I have a really simple chat application on a site which works pretty good.
It requests by ajax like this:
$.ajax({
url: "fetch/"+CHAT_SESSION_ID+"/"+LAST_MESSAGE_ID,
dataType: "json",
cache: ...
2
votes
1
answer
3k
views
Solr Query Delete Limit To 3 Records?
Been using Solr 3.2 and the query delete function limits to 3 records so far. If I send in more than 3, will get the following error:
Apache Tomcat/7.0.12 - Error
report525D76;}--> HTTP Status 500 ...