Is is possible to parse a web page from the client side for a large number of words and if so, how?

Posted by Technoh on Stack Overflow See other posts from Stack Overflow or by Technoh
Published on 2010-05-20T21:24:25Z Indexed on 2010/05/20 21:30 UTC
Read the original article Hit count: 237

Filed under:
|
|
|
|

I have a list of keywords, about 25,000 of them. I would like people who add a certain < script> tag on their web page to have these keywords transformed into links. What would be the best way to go and achieve this?

I have tried the simple javascript approach (an array with lots of elements and regexping/replacing each) and it obviously slows down the browser.

I could always process the content server-side if there was a way, from the client, to send the page's content to a cross-domain server script (I'm partial to PHP but it could be anything) but I don't know of any way to do this.

Any other working solution is also welcome.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about regex