Hallo FireGlow.
Ich muss dynmaisch den onClick-Event eines Buttons verändern.
Dankbarerweise gibts ja dafür folgendes:
out.println("document.getElementById(TD + '_Button').setAttribute("onClick", "addPicture('"+TD+"', '"+nummer+"');");");
Was ist „out.println“ und was hat es mit JavaScript zu tun?
Jedoch klappt das nicht im IE, wie issen da der Befehl für?
Du musst die direkte Variante nehmen:
buttonobject.onclick = function() {
addPicture(wie, auchimmer);
};
Funktioniert in allen Browsern gleich, setAttribute ist also überflüssig.
Einen schönen Dienstag noch.
Gruß, Ashura
--
sh:( fo:} ch:? rl:( br: n4:~ ie:{ mo:| va:) de:> zu:} fl:( ss:) ls:[ js:|
„It is required that HTML be a common language between all platforms. This implies no device-specific markup, or anything which requires control over fonts or colors, for example. This is in keeping with the SGML ideal.“
[HTML Design Constraints: Logical Markup]
sh:( fo:} ch:? rl:( br: n4:~ ie:{ mo:| va:) de:> zu:} fl:( ss:) ls:[ js:|
„It is required that HTML be a common language between all platforms. This implies no device-specific markup, or anything which requires control over fonts or colors, for example. This is in keeping with the SGML ideal.“
[HTML Design Constraints: Logical Markup]