[jQuery] Re: Creating Custom Classes

2007-08-12 Thread Dan G. Switzer, II
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

[jQuery] Re: Creating Custom Classes

2007-08-11 Thread Sean Catchpole
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

[jQuery] Re: Creating Custom Classes

2007-08-11 Thread Eridius
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

[jQuery] Re: Creating Custom Classes

2007-08-11 Thread John Resig
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