Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Ajax
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Ajax the combination of XHTML, CSS, DOM, XML, XSLT, XMLHttpRequest, and JavaScript
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Ajax section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 12th, 2007, 04:31 PM
Registered User
 
Join Date: Sep 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default which is faster

I am updating an html page by adding a lot of divs (some nested) and input elements. I want to know if it is faster to send down the html as a string and then on the client side set the innerHTML of my container div OR if it is faster to send down a JSON (nested) object and have the client side get the JSON structure and create DOM elements for each element in my JSON structure and append those to my container DIV?
Thanks

Reply With Quote
  #2 (permalink)  
Old November 13th, 2007, 04:09 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

In my experience the innerHTML is quicker but less flexible, the code returned will probably only suit the one app.

--

Joe (Microsoft MVP - XML)
Reply With Quote
  #3 (permalink)  
Old November 13th, 2007, 11:02 AM
Registered User
 
Join Date: Sep 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you

Reply With Quote
  #4 (permalink)  
Old December 30th, 2007, 08:56 AM
Authorized User
Points: 64, Level: 1
Points: 64, Level: 1 Points: 64, Level: 1 Points: 64, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2006
Location: Mukalla, , Yemen.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to maz_alaameri Send a message via Yahoo to maz_alaameri
Default

I think that is right

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Suggestion for better / faster processing elygp SQL Server 2000 2 February 13th, 2008 10:47 PM
Which one is much faster in gridview, htmltable anshumannidhi BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 0 October 11th, 2006 04:50 AM
They Want It To Be Faster! kindler Access 7 December 20th, 2005 10:54 AM
c++ faster than Pascal IvAnR C++ Programming 5 August 6th, 2005 01:08 AM
Any faster? Ben Access VBA 19 March 12th, 2004 07:04 PM



All times are GMT -4. The time now is 12:21 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.