exception - jquery error: "missing : after property id" (JavaScript object) -



exception - jquery error: "missing : after property id" (JavaScript object) -

i have code:

$.each(properties, function(i, key) { obj.css({'-webkit-border-' + key + '-radius': value+'px', '-moz-border-' + key + '-radius': value+'px', 'border-' + key + '-radius': value+'px'}); });

it's giving error on first + key

can't create keys (with appending data) or doing else wrong?

thanks, wesley

can't create keys (with appending data) or doing else wrong?

nope, should getting syntax error.

you can build object before passing css function:

var styles = {}; styles['-webkit-border-' + key + '-radius'] = value+'px'; styles['-moz-border-' + key + '-radius'] = value+'px'; styles['border-' + key + '-radius'] = value+'px'; obj.css(styles);

jquery exception

Comments

Popular posts from this blog

c# - Move local mssql database to webhosted MYSQL -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

java - How to pass parameters between Request-Scoped Controllers? -