By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,814 Members | 2,162 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,814 IT Pros & Developers. It's quick & easy.

JavaScript DOM Event

P: n/a
I have created an object similar to this:

function bar(event)
drag(event, this.wid);

function foo(wid)
this.wid = wid;
this.div = document.createElement("div");
this.div.setAttribute("id", wid);
this.caption = document.createElement("div");
this.caption.setAttribute("id", "caption");
this.caption.onmousedown = bar;

Upon running this code this.wid in method bar returns undefined, My
guess is that method bar is running in a different scope, is there
anyway I can customize this method with an additional argument which
would be a variable, or wrap it in another function within object foo's
scope somehow?

Any help is greatly appreciated.

Sep 17 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Nevermind found a workaround myself.

Sep 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.