[jQuery] Re: How to create dom on the fly using jQuery????

2009-03-04 Thread Josh Powell
Simple answer: DOM nodes are created by just writing the html in side of the jQuery $('#divName').append('tabletrtd/td/tr/table'); is equivalent to divResult = document.getElementById(divName); table = document.createElement(table); tr = document.createElement(tr); td =

[jQuery] Re: How to create dom on the fly using jQuery????

2009-03-04 Thread RobG
On Mar 4, 11:28 am, SeeVik vikramvmalhotra1...@gmail.com wrote: Hello all, I am using Symfony with jQuery plugin. The thing is I am getting some data from database in JSON format and I want to use jQuery to display a table using that data on the fly. I was wondering is jQuery the best way

[jQuery] Re: How to create dom on the fly using jQuery????

2009-03-04 Thread James Carr
$('#divName').append('tabletrtd/td/tr/table'); gets you the same effect. Without jQuery I would probably opt to do this (since I long gave up using DOM methods much): var divResult = document.getElementById(divName); divResult.innerHTML = 'tabletrtd/td/tr/table'; it's quicker performance

[jQuery] Re: How to create dom on the fly using jQuery????

2009-03-03 Thread Jack Killpatrick
This isn't jquery-specific, but I've been using this for a couple years now to generate html from json data: http://code.google.com/p/trimpath/wiki/JavaScriptTemplates works great. - Jack SeeVik wrote: Hello all, I am using Symfony with jQuery plugin. The thing is I am getting some data

[jQuery] Re: How to create dom on the fly using jQuery????

2009-03-03 Thread SeeVik
Thanks for the reply Jack. the JST Template looks cool. I will surely look into it. Just for the record, if anybody can throw some light on the original question, it would be really helpful. I don't really want to be left clueless about this thing in jQuery. Thanks and Regards Vikram On Mar 4,

[jQuery] Re: How to create dom on the fly using jQuery????

2009-03-03 Thread Jack Killpatrick
Hi Vikram, jQuery is fine for this. Here's a bunch of info about using .append() for table rows: http://www.learningjquery.com/2009/03/43439-reasons-to-use-append-correctly - Jack SeeVik wrote: Thanks for the reply Jack. the JST Template looks cool. I will surely look into it. Just for the

[jQuery] Re: How to create dom on the fly using jQuery????

2009-03-03 Thread David Muir
Generating DOM manually as you have in your example is probably the slowest method you can use. Using a document fragment would be much faster and is the way that jQuery 1.3 does its appending. Straight HTML insertion is the fastest though. One method that I've used is to basically roll out