OZONE Asylum
Forums
DHTML/Javascript
Javascript - string as variable name?
This page's ID:
32042
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Personally I'd put the data sets either as a TABLE element in the markup, for accessibility reasons, or in private variables to prevent messing up with them. [b]racerX:[/b][code]var objs=[] set1 = {name:'Set 1',data:[1,2,5,8,9,6,3,4,7,8],color:'#c66',id:'set1'}; /* ... */ objs[set1.id]=set1[/code]That's one convoluted way of doing:[code]var objs={}; objs.set1 = {name:'Set 1',data:[1,2,5,8,9,6,3,4,7,8],color:'#c66'};[/code]or a more direct object declaration like the one in the first jsfiddle link. [url=http://www.p01.org/][sigrotate][img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_love.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_love_small.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_charly.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_dk.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_reason.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_galaxy.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_neon88x31.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_teapot.png[/img][/sigrotate][/url]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »