I am trying to pass a parameter to ajax.load()
. I want to pass this
from parent function to ajax.load()
. I want to use this inside it
Here is my code:
ajax.done(function(msg) {
jQuery(this).children('p').append(msg);
});
You can define a variable which will hold the desired value in the closure :
var $this = $(this);
ajax.done(function(msg) {
$this.children('p').append(msg);
});