Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Jargon highlighter

    Hi All

    I've seen quite a number of ASP sites that highlight certain keywords in a
    page and sometimes these words are links so that you can read the definition
    on them, eg ADSL is highlighted in a page of text and if you click on it
    then it takes you to a page explaining what this means.

    Not 100% sure, but it looks like the whole thing is updated by the user via
    CMS so how on earth do they create this jargon highlighter.

    I can understand what's needed from a DB perspective, eg field for the word
    and field for the definition, but how on earth do I find and highlight this
    word in a page of normal text?

    Any ideas on how to do this?

    Rgds

    Laphan


    Laphan Guest

  2. Similar Questions and Discussions

    1. Colour settings for Highlighter Tool and Underline Text Tool
      I am using ACROBAT STD 7.0.1 on Tiger. As I often read scientific PDF files, I would like to use additional colours for the Highlighter (yellow)...
    2. Highlighter Colors
      Help! I am a student, and for an assignment- I need to highlight in at least five different highlight colors. I have a MAC and Adobe...
    3. Highlighter tool
      I have highlighted some text in a PDF document. The color is about 60% gray and looks great on the screen, however, when I print the document, the...
    4. PHP/HTML web syntax highlighter available
      I've released the first proper version of my PHP/HTML syntax highlighter. This program takes HTML from a URL or a file, syntax highlights it and...
  3. #2

    Default Re: Jargon highlighter

    "Laphan" <news@DoNotEmailMe.co.uk> wrote in message
    news:41084b49_3@127.0.0.1...
    > Hi All
    >
    > I've seen quite a number of ASP sites that highlight certain keywords in a
    > page and sometimes these words are links so that you can read the
    definition
    > on them, eg ADSL is highlighted in a page of text and if you click on it
    > then it takes you to a page explaining what this means.
    >
    > Not 100% sure, but it looks like the whole thing is updated by the user
    via
    > CMS so how on earth do they create this jargon highlighter.
    >
    > I can understand what's needed from a DB perspective, eg field for the
    word
    > and field for the definition, but how on earth do I find and highlight
    this
    > word in a page of normal text?
    >
    > Any ideas on how to do this?
    >
    > Rgds
    >
    > Laphan

    Perhaps this?

    <html>
    <head>
    <title>hilite.htm</title>
    <style type="text/css">
    ..hilite { background:yellow; text-decoration:none }
    </style>
    </head>
    <body>
    This text is <a href="http://www.google.com/"
    class="hilite">highlighted</a>.
    </body>
    </html>


    McKirahan Guest

  4. #3

    Default Re: Jargon highlighter

    Dear McKirahan

    Thanks for coming back to me.

    Yes, I can do as you have suggested, but this is a manual process.

    How can I do what you have suggested for a set of user-definable/entered
    words that are stored in a DB?

    Toying with the idea of retrieving the keywords (from the DB) and putting
    them in some form of Javascript array thingy, but not sure yet.

    I don't want to go down the route of storing all textual content in the DB
    or raw FileSys hacking, but this may be the only way I suppose.

    Rgds

    Laphan



    McKirahan <News@McKirahan.com> wrote in message
    news:BrYNc.188016$JR4.56153@attbi_s54...
    "Laphan" <news@DoNotEmailMe.co.uk> wrote in message
    news:41084b49_3@127.0.0.1...
    > Hi All
    >
    > I've seen quite a number of ASP sites that highlight certain keywords in a
    > page and sometimes these words are links so that you can read the
    definition
    > on them, eg ADSL is highlighted in a page of text and if you click on it
    > then it takes you to a page explaining what this means.
    >
    > Not 100% sure, but it looks like the whole thing is updated by the user
    via
    > CMS so how on earth do they create this jargon highlighter.
    >
    > I can understand what's needed from a DB perspective, eg field for the
    word
    > and field for the definition, but how on earth do I find and highlight
    this
    > word in a page of normal text?
    >
    > Any ideas on how to do this?
    >
    > Rgds
    >
    > Laphan

    Perhaps this?

    <html>
    <head>
    <title>hilite.htm</title>
    <style type="text/css">
    ..hilite { background:yellow; text-decoration:none }
    </style>
    </head>
    <body>
    This text is <a href="http://www.google.com/"
    class="hilite">highlighted</a>.
    </body>
    </html>




    Laphan Guest

  5. #4

    Default Re: Jargon highlighter

    "Laphan" <news@DoNotEmailMe.co.uk> wrote in message
    news:41086700$1_3@127.0.0.1...
    > Dear McKirahan
    >
    > Thanks for coming back to me.
    >
    > Yes, I can do as you have suggested, but this is a manual process.
    >
    > How can I do what you have suggested for a set of user-definable/entered
    > words that are stored in a DB?
    >
    > Toying with the idea of retrieving the keywords (from the DB) and putting
    > them in some form of Javascript array thingy, but not sure yet.
    >
    > I don't want to go down the route of storing all textual content in the DB
    > or raw FileSys hacking, but this may be the only way I suppose.
    >
    > Rgds
    >
    > Laphan
    >
    [snip]

    Here's one approach; test as-is; watch for word-wrap.

    It requires that JavaScript be enabled on the client.

    Also, some words may be problematic such as "span".

    <html>
    <head>
    <title>hilites.htm</title>
    <script type="text/javascript">
    var s = 0;
    var word = new Array();
    word[s++] = "one";
    word[s++] = "two";
    word[s++] = "three";
    function hilites() {
    var span = "<span class='hilite'>~</span>";
    var temp;
    var what = document.getElementById("hiliter").innerHTML;
    for (var i=0; i<word.length; i++) {
    var len = word[i].length;
    var pos = what.toLowerCase().indexOf(word[i]);
    if (pos >= 0) {
    temp = what.substr(0,pos) +
    span.replace(/\~/,what.substr(pos,len)) + what.substr(pos+len,what.length);
    what = temp
    }
    }
    document.body.innerHTML = what;
    }
    </script>
    <style type="text/css">
    ..hilite { background:yellow; text-decoration:none }
    </style>
    </head>
    <body onload="hilites()">
    <span id="hiliter">
    One, Two, Three, Four ...
    </span>
    </body>
    </html>



    McKirahan Guest

  6. #5

    Default Re: Jargon highlighter

    can you give an example site?

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    [url]www.ielearning.com[/url]


    "Laphan" <news@DoNotEmailMe.co.uk> wrote in message
    news:41084b49_3@127.0.0.1...
    > Hi All
    >
    > I've seen quite a number of ASP sites that highlight certain keywords in a
    > page and sometimes these words are links so that you can read the
    definition
    > on them, eg ADSL is highlighted in a page of text and if you click on it
    > then it takes you to a page explaining what this means.
    >
    > Not 100% sure, but it looks like the whole thing is updated by the user
    via
    > CMS so how on earth do they create this jargon highlighter.
    >
    > I can understand what's needed from a DB perspective, eg field for the
    word
    > and field for the definition, but how on earth do I find and highlight
    this
    > word in a page of normal text?
    >
    > Any ideas on how to do this?
    >
    > Rgds
    >
    > Laphan
    >
    >

    Mark Schupp Guest

  7. #6

    Default Re: Jargon highlighter

    On Thu, 29 Jul 2004 02:00:29 +0100, "Laphan" <news@DoNotEmailMe.co.uk>
    wrote:
    >I've seen quite a number of ASP sites that highlight certain keywords in a
    >page and sometimes these words are links so that you can read the definition
    >on them, eg ADSL is highlighted in a page of text and if you click on it
    >then it takes you to a page explaining what this means.
    Could be just smart tags, or a variation thereof, though that would be
    client-side. Otherwise, the text is parsed through and links added
    based on a glossary. Try:

    [url]http://www.aspin.com/func/search?tree=aspin&qry=glossary&cat=pr&x=40&y=9[/url]

    Jeff
    Jeff Cochran Guest

  8. #7

    Default Re: Jargon highlighter

    "Laphan" <news@DoNotEmailMe.co.uk> wrote in message
    news:41084b49_3@127.0.0.1...
    > Hi All
    >
    > I've seen quite a number of ASP sites that highlight certain keywords in a
    > page and sometimes these words are links so that you can read the
    definition
    > on them, eg ADSL is highlighted in a page of text and if you click on it
    > then it takes you to a page explaining what this means.
    >
    > Not 100% sure, but it looks like the whole thing is updated by the user
    via
    > CMS so how on earth do they create this jargon highlighter.
    >
    > I can understand what's needed from a DB perspective, eg field for the
    word
    > and field for the definition, but how on earth do I find and highlight
    this
    > word in a page of normal text?
    >
    > Any ideas on how to do this?
    >
    > Rgds
    >
    > Laphan
    [url]http://groups.google.com/groups?threadm=OaUoups%24CHA.2148%40TK2MSFTNGP10.p hx.gbl[/url]


    Chris Hohmann Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139