Replace text with smilies
|
|
I'm creating a script that will replace text smilies like ;) :) :D etc. It's working fine, but each time a page loads, it makes my browser freeze for about 5 seconds, then it loads all the smilies. How can I make my script run faster without making my browser hang? I have already converted the images to data:uris.
|
|
|
Don't use the innerHTML! Look at this thread, there is a very good piece of code how to replace part of text with an element: |
|
|
I can't figure out how to incorporate that into my script. How could I change it to adding an image instead? |
|
|
Also, is there any way to do all the smilies at once, rather than the same function over and over? |
|
|
replace:
|
