> > (function($) { > $.admin.ajax = { > someVar: null, > request: function(formData, jqForm, options) { > alert("Setting someVar = Hello World.") > > this.someVar = "Hello World"; > > return false; // we are testing, don't > really need to submit the > form > } > } > })(jQuery); > >
"this" is not what you think it is when your "request" function executes. Since the callback is invoked by code other than yours (in this case it's invoked by the form plugin) you don't have control over "this". "this" is actually the options object (which is the object that holds the beforeSubmit property. Mike