How to use the context variable in ajaxSetup with jquery
- by user1730491
I have multiple forms on one page and i am submitting them via Ajaxform plugin like this
<td> <form> form1 </form> </td>
<td> <form> form2 </form> </td>
var options = {
target: '.ajaxMessage',
dataType: 'json', // pre-submit callback
success: function(data, statusText, xhr, form){ myResponse(data,form)},
context: { element: this},
cache: false,
delegation: true,
type: 'POST' };
$(".rform").ajaxForm(options);
In mY AjaxSetup , i have this
beforeSend:function(xhr, settings){
$this = settings.context.element;
alert($this);
But its not working , alert says window object