Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is the best html generator using Javascript and JQuery

I need to generate html on the client side depend on the ajax response. what is the best way to do that using Javascript and JQuery

user-image
Question added by Hazem Qannash , Technical Team Leader , Bayt.com
Date Posted: 2012/12/09
Hazem Qannash
by Hazem Qannash , Technical Team Leader , Bayt.com

I used Trimpath Template https://code.google.com/p/trimpath/wiki/JavaScriptTemplates It is very good templating engine to generate html content using javascript

Jose Ricardo Peteros
by Jose Ricardo Peteros , Software Analyst Developer , Standard Chartered Bank

Maybe this one could help for you to start a new template.The templates are responsive already.Check this out.(http://www.initializr.com/)

Ashraf Sabry
by Ashraf Sabry , Freelancer developer , N/A

I prefer using a templating engine rather than creating HTML manually.
There are many many libraries available, but my personal preference is Knockout templates (http://knockoutjs.com/documentation/template-binding.html), or otherwise Underscore templates (http://lodash.com/docs#template)

Fadi Alkhateeb
by Fadi Alkhateeb , Senior Front End Developer , NexTwo

Well, there is many ways: 1.
Append(): $("p").append("Hi"); 2.
innerHTML: var newHTML = "this is in javascript"; document.getElementById('para').innerHTML = newHTML; 3.
createElement: $(document.createElement('div')) 4.
simply write something like $('div'), $('').
Depending on website i just checked : http://jsperf.com/jquery-vs-createelement, createElement seems to be the fastest way to generate html because of less time in proccess and jQuery doesn't have to identify it then create the element.

I think is  jquery templating

Nizar Ka
by Nizar Ka , Senior Software Engineer , xerox

you can use Zen coding and if u want to use in visual studio, there is a plugin called "Web Essentials 2012"

 

Jonathan de Flaugergues
by Jonathan de Flaugergues , software engineer , Abbeal

Get only the data with AJAX request, and bind html templates with this data. 

The best way is to use a javascript framework. 

You can try this with Backbone which easy to use and very popular.

Otherwhise, you can use Angular which is more complex but more efficient.

Muhammad Bilal Ahmed
by Muhammad Bilal Ahmed , Senior Front End Developer , Seven Software Development

WYSIWYG Editor Easy to use : WYSIWYG editors allow novice Web developers to get up and running quickly.
Focused on Design: Most WYSIWYG editors allow the developer to focus more on how the page looks than on how the HTML looks.
This provides people with more creative room.
Specific Tasks Faster It is possible to do specific tasks much faster using a WYSIWYG editor than a text editor.
For example, tables can be created with most WYSIWYG editors using a visual layout of the table.
This is often much faster than typing out all the tags by hand.
Less Likely to Make Mistakes While most text editors include tag validation or integrate with a validator, if you don't use the tools, you can still write tables without end tags that won't display in Netscape.
WYSIWYG does the tags for you, so the only mistakes you'll make are in the design.

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.