Hi there,
I would like to move most of my (javascript) event code to functions in script objects.
Now I simply can't find out how to pass "this" as a parameter to a function.
The naive way is certainly wrong:
sDummy = MyScriptObject.myFunction(this);
function myFunction(myObject) {
return myObject.rawValue; }
Has anyone found a way to solve this?
It certainly would help to reuse code substantially.
Thanks in advance
Ulrich
Views
Replies
Total Likes
Just tried it here and it works for me .....what are you expecting to happen? I added an app.alert(sDummy) and it displayed the value for me.
Paul
Views
Replies
Total Likes
Paul, I was confused. Thanks for kicking me in the ass to try it again!
My problem was not parameter passing. It turned out I misinterpreted the error message.
Folks, go ahead and keep using the script objects! It is worth it. And there is now problem to pass "this" as a parameter to your functions. ![]()
Views
Replies
Total Likes