PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Jump to highlighting

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Jump to highlighting

    Hi,

    I have been playing with the highlighting for a while and it just doesn't seem to work. I created a blank page as below. Inserted the code as I believe I am too. But it doesn't work. I put the highlight.js file in every possible folder and if I go to the same directory that the document is in or the index is in I can download that file so I do have access to it. Any hints as what to do? I have indexed with that check box to check search words and am just searching the word test. Which somes up in the hits just when you click on the link it doesn't highlight the words.

    I am running this on a win2k3 server with cgi if that makes and difference.

    Thank you

    <html>

    <head>
    <style>.highlight { background: #FFFF40; }</style>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>New Page 1</title>
    <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <script type="text/javascript" src="highlight.js"></script>
    </head>


    <body>
    This is a test. Test test test

    </body>
    <script type="text/javascript">highlight();</script>

    </html>

  • #2
    Are your search results passing the keyword name onto the next form when you click on the result.

    Here is what your link on a search result might look like.

    http://yourservername/test.html?zoom_highlight=test

    The javascript code will parse out the keyword after zoom_highlight.

    If you aren't passing the zoom_highlight param your will get no highlighting.

    If this doesn't solve your issue, can you post a link to your search engine (if on the web).

    Comment


    • #3
      Unfortunatly it isn't on the web. It does pass the test word into the browser link. Is there something in the web browser or web server to enable?

      Comment


      • #4
        Make sure your browser has Javascript enabled. What version of browser are you using? You might also want to check if you have any internet security application running which could be blocking Javascript.

        This thread may also help:
        http://wrensoft.com/forum/viewtopic.php?t=410
        --Ray
        Wrensoft Web Software
        Sydney, Australia
        Zoom Search Engine

        Comment


        • #5
          Using IE6. I tried it on a differnet machine and it was the same results. I put that line of code in and it didn't give me the message so I imagine that javascript is enabled.

          So I am at a loss..

          Comment


          • #6
            Problem solved

            I was able to re-create your issue. Looks like a javascript bug in the highlight code. You need to add at least a table, div, or span tag before your content. I added some code to illustrate.

            Don't forget to use the "?zoom_highlight=test" on the end of your url when testing this.

            If you use this code you will get the highlight to work
            <html>
            <head>
            <style>.highlight { background: #FFFF40; }</style>
            <script src="/javascript/highlight.js" type="text/javascript"></script>
            </head>
            <body onLoad="highlight()">
            <div>
            test
            </div>
            </body>
            </html>
            This doesn't, difference is that you need at least some tables, a div, or a span before your content. Small bug in the javascript.

            <html>
            <head>
            <style>.highlight { background: #FFFF40; }</style>
            <script src="/javascript/highlight.js" type="text/javascript"></script>
            </head>
            <body onLoad="highlight()">
            test

            </body>
            </html>
            [/code]
            [/quote][/code]

            Comment


            • #7
              We had a closer look at this, and broman's right, there is a bug in the "jump to highlighting" Javascript. At the moment, it will only highlight and locate text that is enclosed in any pair of tags (so it is not in fact, limited to table, div, or span - it will actually work for anything within

              , [b], etc. tags as well). This excludes the <body> tag, so that is why the bare page example posted above does not work.

              However, the good news is that this helped us locate the problem and we've come up with a fix for the next release which will work for any text within the body tags. This fix will be available in Version 4.2 which is scheduled for a release next week.
              --Ray
              Wrensoft Web Software
              Sydney, Australia
              Zoom Search Engine

              Comment


              • #8
                Great. Thanks a lot guys for your help.

                Comment

                Working...
                X