Datalist pollute the DOM

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Datalist pollute the DOM

Fred .
So I have to do <option>Foo</option>
Repeat that 1000 times, and I have massively polluted my DOM with elements.
Also I want transfer Foo which is 3 bytes, but then I have to transfer
opening and closing tags and that takes lots of bandwidth when you
multiply that by 1000.

You should be able make the client fetch the datalist from the server.
And the server send a CSV or something "Alice,Bob,Clare,Dave,Eve,..."

Reply | Threaded
Open this post in threaded view
|

Re: Datalist pollute the DOM

Jason H-3
1. Enable gzip transfer encoding.
2. Use AJAX and send a JSON request for the list you want, formatted as a string. Tthen just break it apart and programmatically add the items to the list.



From: Fred . <[hidden email]>
To: [hidden email]
Sent: Thursday, August 30, 2012 10:28 AM
Subject: Datalist pollute the DOM

So I have to do <option>Foo</option>
Repeat that 1000 times, and I have massively polluted my DOM with elements.
Also I want transfer Foo which is 3 bytes, but then I have to transfer
opening and closing tags and that takes lots of bandwidth when you
multiply that by 1000.

You should be able make the client fetch the datalist from the server.
And the server send a CSV or something "Alice,Bob,Clare,Dave,Eve,..."