jQuery MVC architecture

Posted by Tomas Barbak on Stack Overflow See other posts from Stack Overflow or by Tomas Barbak
Published on 2010-04-16T17:28:13Z Indexed on 2010/04/16 17:33 UTC
Read the original article Hit count: 219

Filed under:
|
|

Hi,

what is the best way to create MVC architecture in jQuery?

Should I use jQuery.extend()?

jQuery.extend({
  View: function(){}
});

...or jQuery Plugin?

(function($) {

  $.fn.model = function() { return this; }; 

})(jQuery);

...or just objects in JavaScript?

var model = {}
var view = {}
var controller = {}

Thank you!

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery