As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
So there are a bunch of older questions on this topic that point to a number of options available. These two questions for example are some of the most answered on the topic:
What good template language is supported in JavaScript?
jQuery templating engines
Most of the answers to both questions are from 2008.
However in the past year or so the javascript landscape has evolved considerably. For example, the .NET JQuery extensions were recently added as official JQuery plugins.
Out of the current templating engines, which is the best one to use? Here are some options I'm aware of:
JQuery-tmpl
https://github.com/jquery/jquery-tmpl
http://blog.jquery.com/2010/10/04/new-official-jquery-plugins-provide-templating-data-linking-and-globalization/
http://weblogs.asp.net/scottgu/archive/2010/10/04/jquery-templates-data-link-and-globalization-accepted-as-official-jquery-plugins.aspx
http://www.borismoore.com/2010/10/jquery-templates-is-now-official-jquery.html
(formerly an NJE project)
John Resig's Micro-templates
http://ejohn.org/blog/javascript-micro-templating/
included in underscore.js
JTemplates
http://jtemplates.tpython.com/
http://plugins.jquery.com/project/jTemplates
PURE (Pure Unobtrusive Rendering Engine)
http://beebole.com/pure/
ASP.NET Ajax Templates
http://msdn.microsoft.com/en-us/magazine/cc546561.aspx
jQuery Smarty
https://github.com/balupton/jquery-smarty
Given all these different options, which is probably the best one to choose?
I was trying to decide between Resig's Microtemplates and JQuery-tmpl, but I don't know which of the two is better or if there is a better option than either of them.
Can anyone familiar with many of the options available lend some advice on this matter?
The ASP.NET Ajax Library's DataView should not be considered. It was deprecated before release, in favor of jQuery Templates.
I've been using jTemplates for a couple years and have found it to be solid enough. However, with jQuery Templates slated for inclusion in jQuery 1.5 core, it doesn't make sense to take an external dependency that re-implements something already included in the core library. That alone is enough reason to favor jQuery Templates, assuming you're using jQuery.
It's definetely a subjective and argumentative question, I've just wanted to add performance to the list of things you may consider.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I want to learn a pattern / process for making and organising proper javascript applications. I am beginning to use OOP to simplify sections of my code, but the code is still messy so I need a process to build bigger things effectively. Should I be thinking about MVC, namespaces or libraries? Not sure if I want to choose a framework yet but any advice/suggestions is greatly appreciated!
jQuery is the best Javascript framework and you can start looking on it following the official website.
Following this blog you can find many tutorials and lessons as well.
Then if you are interested in MVC pattern to use with Javascript I suggest Backbone.
Here is all you need :
http://dochub.io/#javascript/
http://dochub.io/#jquery/
the basic knowledge of JavaScript is good to learn jquery
since the jquery is the library made in JavaScript you can manipulate and understand jquery better
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm looking for tutorial(s) on how to refactor JavaScript application into a JavaScript application using one of the existing JS MVC frameworks. Anyone got any?
Yes, I recommend the Backbone-Boilerplate located at GitHub.
This is beneficial because, not only do you get the Backbone MVC, but also require.js AMD, and underscore.js templates. The authors have been consistently active, and the code is impressive to work with.
Here are the associated tutorials:
Introduction
AMD Module setup
Boilerplate
Overview
Router Explanation
These were the tutorials I used to get it up and running. Also included is Node.js and Grunt build system. They are very much worth the effort if you are not familiar with them. I just saw today that a jQuery project is incorporating the Grunt build system. This is a good setup.
UPDATE: Apologies if you were already aware of the boilerplate. I realize it does not directly relate to refactoring. This looks like a good post on refactoring MVC.
Documentation may be sparse as it would be specific to how your codebase is architected. The key notion would be Data maps to Model, GUI maps to View, Collections contain multiple models, and the Router is used to route events.
Hope that helps.
All the best!
Nash
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
i don't understand the meaning of the word library -
regarding to jQuery: will it be right to say that "library" is a huge file with many plug ins that are ready to use?
jQuery is a fast and concise JavaScript Library that simplifies HTML
document traversing, event handling, animating, and Ajax interactions
for rapid web development. jQuery is designed to change the way that
you write JavaScript.
All this means is that jQuery itself does not do anything. A library is "a collection of resources used to develop software". jQuery allows you to write cross-browser JavaScript a heck of a lot easier than it would be without it.
A library is something that extends a base langage. So in this definition jQuery is a library
A small(not huge!!!) file (32K only)... With many many functions and features.
Libraries contain code and data that provide services to independent programs. This encourages the sharing and changing of code and data in a modular fashion, and eases the distribution of the code and data.
Wikipedia
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I keep hearing about many JavaScript frameworks i.e.
jQuery
YUI
DOJO
ExtJs
Prototype
Mootools
Scriptaculous
Spry
and a few more.
Can anyone please tell me what specific purpose, do these framework serve?
I am a user of jQuery only.
This is a short description, based on my experience and knowledge (and IMO):
jQuery -> is the most popular javascript library available (great support available on the net and a lot of plugin written for it), it's simple for all (included designers). It's the best choice for dom manipulation and to write code quickly (ideal for front-end)
DOJO -> advanced js library which offers mechanism for loading js "modules" as necessary
ExtJs -> one of the most advanced and powerful js library. It's build with OOP in mind, it offers an huge number of UI components. It's not intended for designers, it's pretty heavy (size of sources). It's the ideal choice for advanced backoffice UI
Prototype -> the evil! Simply avoid this library, it extends default js objects by causing a lot of troubles
YUI -> similar to ExtJS (ExtJs was born as an extension of YUI, so if you have to choose one of the two go for ext :P)
Mootools -> I don't know :P
Scriptaculous -> as far I know, the best for js animations (it was one of the firs library for this task)
Spry -> it introduces some new "concepts" such dataSet. Few people use it :(
These all are javascript libraries, more or less they share the common purpose albeit with different syntax:
Cross-browser issues handling
Animation
Custom dialogs and widgets
Ability to write lesser code
Specific selector engine
Creation/Modification of DOM
Event Handling
Utility Functions
AJAX
Following article is also interesting to read:
Compare JavaScript frameworks
Given they are all JS frameworks they serve almost the same purpose as jQuery serves, by they differ in things such as ease of use, feature richness, UI components, shielding from browser specific functionality, performance, and many others.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I am looking for a good UI library for web development. I expected it to be lightweight which means that it should not generate too much dom structure and also easy to customizable. I have tried dijit but it is too complicated.
Besides, another concern is it seems that all the UI library is based on the core library, for example, dijit is based on dojo, jquery-ui is based on jquery. If I choose one core library, it seems it would be not a good idea to choose another type ui library.
Why would it seem that a UI library based on a core library isn't a good idea? That's a pretty good example of modularity.
At the moment, I'm pretty sure that jQuery wins. Really, the learning curve is super low and there's a huge community for it.
My own experiences with jQuery have been great so far. Ripping off scripts (either global modular stuff or widget-specific) is a breeze and generally, if you can think of something that you want to do with it that's not in the core lib, someone's already created a plugin for it.
As for the UI element, the UI lib is great and recently I've been developing with the theme roller framework, which makes skinning/theming rediculously easy.
/2cents