Bug Tracker

Changes between Initial Version and Version 3 of Ticket #6909


Ignore:
Timestamp:
Aug 16, 2010, 9:40:58 PM (10 years ago)
Author:
dmethvin
Comment:

A function called from within the event handler gets a this object based on the way you call it. If you call it like func(args) then this==window. You either need to pass the event handler's this to the function, as you've done, or remove the _this argument in collapsable_toggle and its this to the same as the event handler by using Function.call or Function.apply:

collapsable_toggle.call(this, '.subtag');

This is not a bug. If you need help with Javascript and jQuery, ask on the forum: http://forum.jquery.com

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #6909

    • Property Status changed from new to closed
    • Property Resolution changed from to worksforme
  • Ticket #6909 – Description

    initial v3  
    1 
    21"this" is not what expected in $(selector).each(function(){...}) called from an event handler bound with $(selector).bind('event',function(){handler(this,data)})
    32