Auto Hyperlink from HTML Header

Wondering if there is a way to auto hyperlink certain words or codes. I am working with an online program that will only let me edit the header and footer of a page and the middle/content is a result from a search.

For example:
If I were to search for tech and in the results was “Google”.
What code would I need to put in the header that would make that Google automatically hyperlink to www.google.com?

Another solution would be automatically highlighting certain text.

Please help.

About the Author, Dan Cameron:

I'm the owner and solution engineer at Sprout Venture, a web solutions company that specializes in web development including WordPress.

I started my first blog in 2003 and transitioned to WordPress in 2004. Since moving to WordPress I've written a few plugins and themes for public consumption. Lately I'm busy engineering/building/coding and have only been able to share a few code snippets.

If you're in need of some web development, web design or custom WordPress plugins and/or themes contact me, I'll be happy to discuss it with you.

Read More »

  • Dan
    If the middle content is actually part of the same document (not a frame), you can do it with javascript, just navigating through the document (assuming it's well formed) and replacing any given text with a specific link.

    I control the header and footer.

    Can you give me an example or point me in the right direction? Thanks.
  • Dan
    link, click on search the catalog. After the search is submitted I want to change the contents of the result to hyperlink on certain codes or acronyms. I do have access to change the header and footer, like I said.

    What javascript function can I use? I can't find it.
  • If you do have control of the client browsers and want to do something like this, I would look into GreaseMonkey, which is a framework for adding user defined javascript to any (or all) pages that are loaded into Firefox. You could definitely do what you want with this, assuming you can make them use Firefox and install your scripts in their browsers before they go to your site.
  • If the middle content is actually part of the same document (not a frame), you can do it with javascript, just navigating through the document (assuming it's well formed) and replacing any given text with a specific link.

    If it's a frame to another site (which I suspect based on your description) then you won't be able to modify it's contents from a different frame that you do have control over - unless perhaps they are both coming from the same domain.

    I think what you're thinking of is the functionality of the Google toolbar, which can add links to addresses and other keywords. You could use that (or make your own app that does the same thing), but the problem with that is you can't rely on that as part of your design, since it requires the client to have it installed when they visit your site. Unless, of course, it's an internal application where you do have this kind of control over the client browsers.
blog comments powered by Disqus