[Greasemonkey] defined functions

Tobias Orterer orterer at gmail.com
Tue Jul 19 21:59:58 EDT 2005


test.user.js:
---
[...]header[...]

function foo() {
       alert("bar");
}

document.getElementsByTagName( "center" )[0].innerHTML = 
"<form name=\"search\" onsubmit=\"return false;\">"
+ "<input type=\"text\" name=\"username\" />"
+ "<input type=\"submit\" name=\"submit\" value=\"suchen\"
onclick=\"search();\" />"
+ "</form>" + document.getElementsByTagName( "center" )[0].innerHTML;

--

when i click the button, javascript says: "foo is not a function"
???



-- 
PGP: 1D87 2E28 B3A5 EEAE 19EB  01C1 ED45 5B31 39AA 1669


More information about the Greasemonkey mailing list