Markus**: Prototyping Problem

Beitrag lesen

Hallo Forum,

ich habe ein Problem mit JavaScript OO, es äußert sich in der folgenden Methode, bzw, bei deren Aufruf:

var t = new vehicle;  
t.Route_name("Test"); //Zeile 122  

hier gibt firefox die Meldung: //Fehler: uncaught exception: [Exception... "Illegal operation on WrappedNative prototype object"  nsresult: "0x8057000c (NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)"  location: "JS frame :: file:///C:/bin/htdocs/kals.de/bus/scheduler/test.html :: <TOP_LEVEL> :: line 122"  data: no]" aus.//
Die dazugehörige Methode:

vehicle.prototype.Route_name = function(value) {  
	if (value != null) {  
		this.route_arr.push(value);  
		this.destination = value;  
		}  
	else  
		{  
		var temp = this.route_arr.shift();  
		this.route_arr.push(temp);  
		return temp;  
		}  
}

Was mach ich falsch?

Cheers, Markus**!