javascript - Getting syntax error my code -


i have code below, error:

syntaxerror: missing } after property list });  tb = ext.getcmp('head-toolbar');     tb.add({         text: 'export',         menu: ext.create('ext.menu.menu', {             items: [                 {                     text: 'export',                     handler: function() {                         alert('test');                     }                 }                 ]             });         }); 

can spot error ?

a correct incomplete answer here, deleted, here's cw reiterating , expanding on it:

you want remove ; indicated:

tb = ext.getcmp('head-toolbar'); tb.add({     text: 'export',     menu: ext.create('ext.menu.menu', {         items: [             {                 text: 'export',                 handler: function () {                     alert('test');                 }             }         ]     }) // <== don't put ; here }); 

you because semicolon ends statement, you're still within outermost object initializer (the 1 you're passing add), you're not ending statement there. doing syntax error.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -