Bug Tracker

Custom Query (13852 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (79 - 81 of 13852)

Ticket Resolution Summary Owner Reporter
#88 invalid "this" functionality change after rev.110 [email protected]
Description

$("#submitbtn").each(function(){ this.disabled = true; this.value = "Searching ..."; });

In r.110, the button with id submitbtn changes. In r.158, the button doesnt do anything.

#6909 worksforme "this" is wrong in $(selector).each(function(){...}) luxigo
Description

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

http://pastie.org/1096449

#2445 wontfix "this" refers to window object in $.map() flesler ratbeard
Description

Hello,

I found that 'this' inside of the callback function in $.map() refers to the window object, and not the current unmapped value. This is inconsistent with the other iteration functions, i.e. $().map, $.each, and with the jQuery documentation at http://docs.jquery.com/Utilities/jQuery.map#arraycallback Here's an example that shows the different behavior between using 'this' and the passed in element object:

$.map(["hey"], function(el) { return $('<div>').text(el + ' yo'); })[0].appendTo('body');

--> "hey yo"

$.map(["hey"], function(el) { return $('<div>').text(this + ' yo'); })[0].appendTo('body');

--> "[object Window] yo"

Its a small fix - just calling the callback in the elements scope. I've attached a diff that fixes the problem.

Mike

Note: See TracQuery for help on using queries.