I have an array like this
var words = [
{
word: 'Something',
link: 'http://www.something.com'
},
{
word: 'Something Else',
link: 'http://www.something.com/else'
}
];
I want it to search the page for word and replace it with link. Is there an efficent way of doing this? It seems it may be CPU hungry.
Sorry should have exlained more...
It would search each element with the class .message for instance. Then find all of the words within that.
There would also be a few hundred within this array
See Question&Answers more detail:os