Jump to content

Trying to make a search engine, without using innerHTML


tibberous

Recommended Posts

I have a javascript page that have a big array of names. I want to be able to have the user enter a search string, and it return the names that match.

 

I was going to just build a long html string of the results, and set the innerHTML of a div, but it seems to break in IE if a lof of results are returned (only like 200). Is there a better way to handle this?

It breaks because of the length. It is browser specific and sometimes varies even between requests.

 

I was able to fix it by using the DOM methods addChild and removeChild. When I still use innerHTML, it is only for small chunks at a time, and since I create one single div in memory, and then attach it, it runs great.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.