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

ios - Fragment Shader GLSL for texture, color and texture/color -

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -