For a button, I need to set the function this calls, and the value used in that call, at runtime. I can do this like so:
var myfunction = /* ... */
var myvalue = /* ... */
button.setAttribute ("onclick", myfunction + "('" + myvalue + "')");
If I try instead:
button.setAttribute ("onclick", function () { myfunction(myvalue));
Firebug gives me a
"function statement requires a name"
even though, as far as I'm aware, I'm using a function expression here.