The following code loads html content from a file (i used this thread)
Within the AJAX callback, this
is bound to a different object. If you want to reuse the target of your plugin, store (capture) it in a local variable and use that.
$.fn.loadWithoutCache = function (){
var $target = $(this);
$.ajax({
url: arguments[0],
cache: false,
dataType: "html",
success: function(data) {
$target.html(data); // note change
}
});
}