testvar has no properties..

Geflügel

Erfahrenes Mitglied
Code:
					<script type="text/javascript">
					<!--
					  	var testvar= testclass ( 'a', 'b'  );
					//-->
					</script>
					<a href="#" onclick="return testvar.classfunc(0);">test</a>

Fehler:
testvar has no properties..

Wieso kann ich classfunc nicht aufrufen? Was mache ich falsch?
 
Hi,

ich nehme an, testclass ist ein Objekt. Dann sollte die Variable mit new instanziiert werden.
Code:
var testvar = new testclass ( 'a', 'b'  );
Ciao
Quaese
 
Zurück