You can use jQuery.proxy()
with anonymous function, just a little awkward that ‘context’ is the second parameter.
$("#button").click($.proxy(function () {
//use original 'this'
},this));
More Related Contents:
- Difference between $(this) and event.target?
- How do I pass the this context to a function?
- How to force addition instead of concatenation in javascript [duplicate]
- jQuery $(this) keyword
- How can I exclude $(this) from a jQuery selector?
- $(this) doesn’t work in a function
- Difference between $(this) and this in jquery
- Typescript “this” inside a class method
- jQuery $(this) selector function and limitations
- jquery – scope inside $(document).ready()?
- What’s the difference between ‘$(this)’ and ‘this’?
- Downloading jQuery UI CSS from Google’s CDN
- Parse RSS with jQuery
- How do I format a Microsoft JSON date?
- jqgrid reloadGrid with loadonce set to true
- The specified value does not conform to the required format yyyy-MM-dd
- .live() vs .bind() [duplicate]
- Jquery get input array field
- How to get input type using jquery?
- How to use jQuery to add form elements dynamically
- Should one replace the usage addJSONData of jqGrid to the usage of setGridParam(), and trigger(‘reloadGrid’)?
- How to close jQuery Dialog within the dialog?
- jQuery select by class VS select by attribute
- Weird Chrome prototype/jQuery conflict
- jQuery/CSS: line-height of “normal” == ?px
- Why jQuery does not work on my home (local) machine?
- jquery – Read a text file?
- How to Parse XML Cross-domain in jQuery?
- Trying to make multiple background images cycle through a slideshow with CSS and JQUERY
- scroll up and down a div on button click using jquery