Forum Moderators: open

Message Too Old, No Replies

IntelliText Type of Javascript

Create a link after the page and HTML has rendered

         

indigojo

7:21 am on Apr 11, 2006 (gmt 0)

10+ Year Member



I need to create and Intellitext type of link. I have a list of keywords in a flat file and want to use javascript to create a hyperlink on the anchor text for a keyword when a match is found in the flat .txt file. I don't want to use repeated calls to the database as I'm sure this would make the server fall over. I want to increase the sites stickyness by hyperlinking to other related articles on the site by highlighting keywords on the "fly".

so text file contains keywords

blue widget
red widget
green widget

and article contains "blue widget" keyword. After the page has loaded I'd like to call the javascript to highlight, hyperlink all instances on "blue widget" on that page with something that creates the same action as the HTML below after the page has rendered.

<a href="?keyword=blue%20widget">blue widget</a>

Is this at all possible? Can anyone post some pointers please?

phillipandrews

1:09 pm on Apr 11, 2006 (gmt 0)

10+ Year Member



Probably, you wouldn't want to do this with JavaScript. Better use something like sed (if you know what that is) in a CGI script to do a batch editing thingamajig that does what you are trying to do. Funny thing... I've seen this done with Google but nowhere else.

Hoping you know CGI,
- Phillip