Loading...
Copy code
Close
Permalink
Close
Please tell us why you want to mark the subject as inappropriate.
(Maximum 200 characters)
Report Inappropriate
Cancel
Private Message
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Cancel
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Update
Cancel
Feedback
Email ID
Subject :
Comments :
Send
Cancel
Private Message
Type the characters you see in the picture below.
Type the characters you see in the picture below.
Attach files
Desktop
Google Docs
Each Attachment size should not exceed 1.0 MB.
Max no of attachments : 3
Loading User Profile...
guest
Response title
This is preview!
Attachments
Publish
Back to edit
Cancel
(
)
Sign In
New to this Portal? Click here to
Sign up
You can also use the below options to login
Login with Facebook
Login with Google
Login with Yahoo
jQuery
Plugins
UI
Meetups
Forum
Blog
About
Donate
All Forums
Recent Posts
Log In
Search
jQuery
Search
jQuery Forum
Screen name:
namarius
namarius's Profile
1
Posts
3
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Ideas
Problems
Expanded view
List view
Private Message
Changing behavior of events to use something else than this
[6Replies]
21-Mar-2010 01:17 PM
Forum:
Developing jQuery Core
If you use events the this reference is overwritten with the
triggering DOM object. In classes this is not very useful because a
direct called function looses their this reference. My suggestion is
to give the user a method to change the behavior of events in the way
that the user can set a new name where the DOM object reference is
saved. For Example:
var A = {
var1 : 1,
f1 : function() {
alert(this.var1) //will fail when event calling f1 directly
alert(A.var1) //will always work
}
};
$(window).ready(A.f1);
now the new behavior:
var A = {
var1 : 1,
f1 : function() {
alert(this.var1); //should not fail if event calling f1 directly
alert(A.var1); //will always work
alert(this.DOMref); //should output the DOM object witch triggered the event
}
};
$(window).ready(A.f1,"DOMref");
«Prev
Next »
Moderate user : namarius
Forum