[JavaScript] stom foutje waarschijnlijk

Pagina: 1
Acties:

  • D-RiSe
  • Registratie: September 2000
  • Laatst online: 19-03 19:37

D-RiSe

Kick the baby

Topicstarter
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function getMoveableObjects() {
// define moveableObjectsHere
    var objArray = new Array('scanLine1', 'scanLine2');
    return objArray;
}

// put this function in the bodyOnload thingy do init the objects

function initObjects() {
    var objectArray = getMoveableObjects();
    for (var x = 0; x < objectArray.length(); x++) {
        alert(objectArray[x]);
    }
}

de regel die een fout geeft is de "for (blabla)" regel... hij zegd "function expected"

wat doe ik fout?

intel silver reef, celly 2.0 Ghz, 256mb ddr, G2MX


Verwijderd

Hoort zo:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function getMoveableObjects() {
// define moveableObjectsHere
    var objArray = new Array('scanLine1', 'scanLine2');
    return objArray;
}

// put this function in the bodyOnload thingy do init the objects

function initObjects() {
    var objectArray = getMoveableObjects();
    for (var x = 0; x < objectArray.length; x++) {
        alert(objectArray[x]);
    }
}

Dus length zonder haakjes erachter :).

  • D-RiSe
  • Registratie: September 2000
  • Laatst online: 19-03 19:37

D-RiSe

Kick the baby

Topicstarter
thx...

intel silver reef, celly 2.0 Ghz, 256mb ddr, G2MX