SyntaxError: Unexpected token o in JSON at position 1

The JSON you posted looks fine, however in your code, it is most likely not a JSON string anymore, but already a JavaScript object. This means, no more parsing is necessary. You can test this yourself, e.g. in Chrome’s console: JSON.parse() converts the input into a string. The toString() method of JavaScript objects by default returns [object Object], resulting … Read more

Javascript versioning to avoid caching, difference in these practices?

Using an updated querystring is a bad solution. See what Steve souders has so say about it: http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/ The ideal method is to rename the file itself. Some people prefer using the time stamp of the last modification date, which i think is a problem. In modern web development you really need to optimize your page … Read more

How to detect Safari, Chrome, IE, Firefox and Opera browser?

Googling for browser reliable detection often results in checking the User agent string. This method is not reliable, because it’s trivial to spoof this value.I’ve written a method to detect browsers by duck-typing. Only use the browser detection method if it’s truly necessary, such as showing browser-specific instructions to install an extension. Use feature detection when possible. Demo: https://jsfiddle.net/6spj1059/  Run … Read more

Javascript versioning to avoid caching, difference in these practices?

Using an updated querystring is a bad solution. See what Steve souders has so say about it: http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/ The ideal method is to rename the file itself. Some people prefer using the time stamp of the last modification date, which i think is a problem. In modern web development you really need to optimize your page … Read more