the problem is that while the .src property is successfully set, the .onclick property isn't (i.e. I see the proper image, but clicking on it does nothing).
var thisObj = document[String(x) + String (y)];
thisObj.src = 'myImage.png';
thisObj.onclick = function () {myFunc(String(x), String(y)};
You should pretty much never use "eval" and the handlers take functions not strings.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
If you use thisObj.onclick = myFunc then inside "myFunc" you can access the object with "this". You should be able to make your function work with that.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
Something odd: unless I put myFunc inside a setTimeout call, things do not go well at all. There is no end of the strangeness. For instance, without the setTimeout, even FireBug gets confused, and its trace function skips lines for not reason at all. I don't know why it occurred to me that using setTimeout would help, but it does, so that's all to the good. Thanks again.
Bookmarks