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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.