In Chrome, you may encounter such a small problem. Enter a random object, such as {Name: ' Wang Nima ', age:20}, will be an error. Before, and never thought about why.
Today, just see Blog Park has bo friend article, by the way record.
In JavaScript,: There are three kinds of functions, presumably everyone knows, its 13-dollar expression true? A:B, the second is used in the case statement in the switch case, and the third is in the object direct amount expression.
In fact, in JS,: There is also a usage, as shown below, the content from W3school, often used for looping statements
Label:statement--- syntax var iNum = 0; outermost: for (var i=0; i<10; i++ ) { if (i = =5 )continue outermost ; }
Then, the error in the console is obvious, because when the {Name: ' Wang Nima ', age:20} is encountered, it is run directly as a block of statements and then parsed into a label statement, resulting in a syntax error.
Speaking of this, in fact, when you use Ajax, not often also encountered a problem, why to the return of the JSON string to be eval ("(" +data+ ")?)?
Thank
Http://www.cnblogs.com/binarytree-fe/p/4950798.html
Http://www.cnblogs.com/webflash/archive/2009/11/15/1603537.html
About a small detail problem in JavaScript (direct {} object error problem in console)