views:

52

answers:

2

Perhaps I'm just being dense, but I don't understand why Netbeans is telling me this is bad syntax:

var events = {
    'onkeyup'  : 0,
    'onchange' : 0,
    'onclick'  : 0
};

Lines 2-4 are squiggled red.

+2  A: 

I did a quick test in my netbeans 6.9, and i did not get any warnings or errors. You should probably try and install the "Web Applications" plugin and see. Which version are you using?

naikus
A: 

D'oh! I failed to realize that this JavaScript is being parsed by PHP and contains some PHP code prior to the object literal assignment. Apparently the JavaScript Debugger is not too happy about statements like:

var foo = <?php print $bar ?>;

Go figure. :P

Dave