R
Reiver
I am creating a nuber of javaScript Arrays from a sql database via
php. It is vey convenient for me to use the sql primary index to form
the Array index, Now so far everything works perfectly, however is
this tactic bad practise that is likely to fail at some point in some
browser somewhere???
a small example of what i am doing is below
var vals = new Array();
vals[34]='a';
vals[44]='b';
vals[54]='c';
vals[134]='d';
vals[234]='e';
vals[26]='f';
I do appriciate i could use a dimensional (is that what its called)
array such as
var vals = new Array();
vals[0] = new Array(34,'a');
vals[1] = new Array(44,'b');
etc.
however my first example works and is far more convenient!
alert(vals[134]);
php. It is vey convenient for me to use the sql primary index to form
the Array index, Now so far everything works perfectly, however is
this tactic bad practise that is likely to fail at some point in some
browser somewhere???
a small example of what i am doing is below
var vals = new Array();
vals[34]='a';
vals[44]='b';
vals[54]='c';
vals[134]='d';
vals[234]='e';
vals[26]='f';
I do appriciate i could use a dimensional (is that what its called)
array such as
var vals = new Array();
vals[0] = new Array(34,'a');
vals[1] = new Array(44,'b');
etc.
however my first example works and is far more convenient!
alert(vals[134]);