Autor |
Beitrag |
Wolle92
Beiträge: 1296
Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
|
Verfasst: Sa 11.10.08 22:11
Hallo,
jaja, der Wolle is ausm Urlaub zurück und hat gleich nen Problem...
Und zwar bringt das onchange-Attribut mein Javascript zum Aufhängen:
Quelltext 1:
| document.getElementByName("building").onchange = changeCookieValue(); |
Das funktionierte nicht, also habe ich testweise mal den aktuellen Wert von onchange auslesen wollen:
Quelltext 1:
| alert("onchange: " + document.getElementByName("building").onchange); |
Aber auch das hat mein Script zum Aufhängen gebracht, weder diese Meldung, noch eine darauf folgende Testmeldung "b" erschien...
Die Testmeldung "a" direkt davor wird aber noch ohne Probleme ausgeführt...
Zur Info:
Ich nutze Firefox und das ganze ist ein Greasemonkey Userscript...
_________________ 1405006117752879898543142606244511569936384000000000.
|
|
Wolle92
Beiträge: 1296
Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
|
Verfasst: So 12.10.08 12:52
okay, es muss getElementsByName heißen, aber irgendwie will das Select (welches übrigens direkt in HTML gecodet ist) trotzdem kein onchange annehmen...
und auch nicht ausgeben...
_________________ 1405006117752879898543142606244511569936384000000000.
|
|
Martok
Beiträge: 3661
Erhaltene Danke: 604
Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
|
Verfasst: So 12.10.08 15:55
Quelltext 1:
| document.getElementsByName('building')[0].onchange = function() { } |
geht nicht?
Was sagt denn Firebug zu dem Thema?
_________________ "The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
|
|
Wolle92
Beiträge: 1296
Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
|
Verfasst: So 12.10.08 16:48
wie kriege ich firebug denn dazu, was du nem GM-Skript zu sagen?
_________________ 1405006117752879898543142606244511569936384000000000.
|
|
Martok
Beiträge: 3661
Erhaltene Danke: 604
Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
|
Verfasst: So 12.10.08 16:58
Naja, wenn da ein Script-Fehler war dann meldet der sich normalerweise schon...
Alternativ macht sich console.log() auch immer ganz gut. Wenn man dem Objekte übergibt, kann man die auch gleich im DOM-Inspektor laden.
_________________ "The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
|
|
Wolle92
Beiträge: 1296
Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
|
Verfasst: So 12.10.08 17:04
naja, wenn ich einfach die Konsole mitlaufen lasse, dann bekomme ich nix...
obwohl die Zeile direkt aufgerufen wird...
_________________ 1405006117752879898543142606244511569936384000000000.
|
|
Martok
Beiträge: 3661
Erhaltene Danke: 604
Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
|
Verfasst: So 12.10.08 17:17
Zeig mal den ganzen Code bzw. zumindest das direkt drumrum... es müsste eigentlich gehen
_________________ "The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
|
|
Wolle92
Beiträge: 1296
Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
|
Verfasst: So 12.10.08 17:24
das direkt darum ist atm alles auskommentiert...
und value zum Beispiel lässt sich auch abrufen...
_________________ 1405006117752879898543142606244511569936384000000000.
|
|
Wolle92
Beiträge: 1296
Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
|
Verfasst: So 12.10.08 22:13
Lösung gefunden:
www.oreillynet.com/p...pitfalls.html?page=3
Da die Nummer zwei...
So funktionierts bei mir auch endlich...
Jetzt muss ich nur noch rausfinden, wie ich Cookies eine bestimmte Zeit lang speichern lassen kann, nicht nur bis ans ende der sitzung...
hat sich auch erledigt, GM_setValue und GM_getValue sind besser...
_________________ 1405006117752879898543142606244511569936384000000000.
|
|
Martok
Beiträge: 3661
Erhaltene Danke: 604
Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
|
Verfasst: So 12.10.08 22:42
_________________ "The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
|
|