John,
To write a class how you like, you could do it like this:
function ajax_request(options){
// initialize
this.setOptions( options );
}
ajax_request.prototype = {
// members and properties
setOptions: function(options){
this.options = options;
}
};
That's the full source
Mootools tries be a bit more C-like, where jQuery uses javascript OO like
peanut butter and jelly.
//jQuery version
var ajax_request = function(options) {
op = { }; //default options
$.extend(op,options); //overwrites defaults
//more code here like $.ajax()
}
~Sean
Well i guess that works for what i need, i just think that have a separate
class is better in certain cases so having both option is nice.
Sean Catchpole wrote:
Mootools tries be a bit more C-like, where jQuery uses javascript OO like
peanut butter and jelly.
//jQuery version
var
To write a class how you like, you could do it like this:
function ajax_request(options){
// initialize
this.setOptions( options );
}
ajax_request.prototype = {
// members and properties
setOptions: function(options){
this.options = options;
}
};
That's the full source code - no
4 matches
Mail list logo