This is probably just a question of syntax but i cant figure it out!
i have a javascript class with several functions, one being something like ...
Expand|Select|Wrap|Line Numbers
- TreeView.prototype.showItems = function(id) {
- itemImg = document.createElement("img");
- itemImg.src = "images/treeplus.gif";
- itemImg.onclick = function(){this.otherfunction();
- document.appendChild(itemImg);
- }
- TreeView.prototype.otherfunction = function(id) {
- //do something
- }
Expand|Select|Wrap|Line Numbers
- itemImg.onclick = function(){this.otherfunction();
any ideas? (or a work around)
Ta
Andy