Raphael: Hashes in Javascript

Hallo,

imho sollte sowas gehen ?

#################################
var myArray = new Array();

myArray['ARN-Suche']['TYP'] = '1';
myArray['IP-Adressen Bank']['DB'] = '1';
myArray['IP-Adressen Bank']['SK_1'] = '1';
myArray['IP-Adressen Bank']['SM_1'] = 'IP';
myArray['IP-Adressen Bank']['WK_1'] = '1';
myArray['IP-Adressen Bank']['WM_1'] = '1';
########################################

Ich bekomme aber eine Fehlermeldung:

myArray['ARN-Suche'] has no properties

Was muss ich machen ?

Gruss,

Raphael

  1. hi,

    ok - hab den Fehler selbst gefunden !
    Ich muss auch noch mal ein "new Array()" auf die naechste Ebene anlegen.

    Gruss,

    Raphael

    Hallo,

    imho sollte sowas gehen ?

    #################################
    var myArray = new Array();

    myArray['ARN-Suche']['TYP'] = '1';
    myArray['IP-Adressen Bank']['DB'] = '1';
    myArray['IP-Adressen Bank']['SK_1'] = '1';
    myArray['IP-Adressen Bank']['SM_1'] = 'IP';
    myArray['IP-Adressen Bank']['WK_1'] = '1';
    myArray['IP-Adressen Bank']['WM_1'] = '1';
    ########################################

    Ich bekomme aber eine Fehlermeldung:

    myArray['ARN-Suche'] has no properties

    Was muss ich machen ?

    Gruss,

    Raphael

  2. #################################
    var myArray = new Array();

    Nimm nicht Array sondern Object()

    http://forum.de.selfhtml.org/archiv/2004/8/t86318/#m510547

    Struppi.