Results 1 to 9 of 9
Mar 15, 2007, 04:26 #1
- Join Date
- Sep 2004
- 0 Post(s)
- 0 Thread(s)
Dynamic Elements: createElement or innerHTML?
I added an AJAX search feature to my website. It works similar to the new windows vista start menu search shortcut feature.
What happens is the user requests a keyword search, the request is sent to a PHP script which sends it back to the browser. This is all done with xmlhttp, thus AJAX.
However, instead of having to create so many elements, one solution would be to change the innerHTML of the parent element. So each time the results are fetched, then the innerHTML would simply be <a href="?link1">link1</a> <a href="?link2">link2</a> and so on...
So which method should be used here? Both work, only I don't think that the innerHTML solution is correct and the createElement method is too slow...I can't believe I ate the whole thing