JQuery Error Message missing: after property id

Posted on

This is an article which is discussing on how to solve an error stated in the title of the article. The error message which is mentioned in the title of the article is ‘missing: after property id’. It is an error message involving an error triggered upon executing or accessing a web-page with a JQuery snippet code attached to it.

The error is still connected with the one which is discussed in the article titled ” in this link and another article titled ” in this link. These two articles are discussing the same focus on declaring an array associative variable with different error message generated.

The error message can be seen in the following image as shown below :

JQuery Error Message missing: after property id

It is an error message triggered which is displayed in Firebug plugin added and installed in Mozilla Firefox Web Browser. The error message itself is detailed as the following :

SyntaxError: missing : after using property id

The old snippet code which is causing the above snippet code is shown as follows :

var db_list = {"1"->"PostgreSQL","2"->"MySQL","3"->"Microsoft SQL Server"};

So, in order to solve the problem concerning the above error message, below is the actual snippet code which can be used as a declaration of the correct associative array variable. The correct one to declare the associative array variable which is also discussed in another two articles is shown below :

var db_list = {"1":"PostgreSQL","2":"MySQL","3":"Microsoft SQL Server"};

As it can be seen in the above snippet code which is used to correct the problem, the separator between the key and the value of a single entity in an array associative is marked by the sign “:”. It is not marked by the sign “->”. And to separate an entity with another entity, the sign “:” is used.

It is actually correct, the usage of “:”, because it is what has been said in the error message. As the error message pointed out that it is a SyntaxError, the “:” must be taken for a missing sign after defining an id which can be considered as the key part of the associative array.

Leave a Reply