Mitch Mitch - 1 year ago 99
jQuery Question

How do I set names.x

I want to know how to set x names in a option variable.

var names = {};

and then set
names.{username from event (e.user.username)} = 1;

Answer Source

You can use bracket notation to pass variable as key.

var username = 'Lorem';
var names = {};

names[username] = 1;

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download