PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

A problem with: <body onload="highlight();">

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

  • A problem with: <body onload="highlight();">

    Hi all

    Great peice of software but I have a niggling problem with the search template page.

    When it loads in internet explorer and when taken to the results page I get the "Error on page" warning bottom left of browser.

    This is pointing to a problem with: <body onload="highlight();"> tag.

    I read somewhere that this could be typo so I tried <body onload="highlight()">

    I have also tried removing this tag and using <script type="text/javascript">highlight();</script> at the end of the page. I get a different error.

    This is the only problem I can see and I would appreciate someone pointing out where I have gone wrong.

    Thanks

    Mike
    the site:
    http://www.advaitavedanta.co.uk/search/search.php

  • #2
    You do not need the "highlight.js" script on your actual search page. This would serve no purpose since all words within the result listing are already highlighted by the search script itself with the "Highlight ... Words matched in search results" option enabled in the configuration window (under the "Results Layout" tab).

    Remove those changes you've put in place in the "search_template.html" file, and let us know if you continue to have this error.
    --Ray
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine

    Comment


    • #3
      I still get the error on the search page?

      Thanks for your reply.

      I just tried taking out:

      <script type="text/javascript" src=
      "http://www.advaitavedanta.co.uk/search/highlight.js">
      </script>

      I still get the error on the search page?
      http://www.advaitavedanta.co.uk/search/search.php

      It is always pointing to the body tag??

      Regards
      Mike

      Comment


      • #4
        Is this problem just in

        Hi again.

        Not many replies to this question, so I'm thinking...

        Is this problem just in my browser or can everyone else see?

        Thanks

        Mike

        Comment


        • #5
          ... and remove the ' onload="highlight()" ' from the search templates body tag.
          Mark Gallagher

          Comment


          • #6
            Yes, you also needed to remove the "onload=" attribute in your body tag for the "search_template.html" file.

            Looking closer, we did eventually find the root of this problem. It turns out that the error message occurs when the "highlight.js" file is linked to a page using UTF-8 encoding (aka charset). In mike's case, this was not obvious because his actual site does NOT use UTF-8, and neither does his search_template.html.

            However, he has (perhaps mistakenly) selected UTF-8 encoding in the Indexer configuration window. This forces the search page to be UTF-8 encoded, thus triggering the error. (There should have also been a warning message after indexing, regarding the encoding in the template not matching the indexing configuration).

            We will update "highlight.js" with a fix to avoid this whole issue in the next build of Zoom (4.0.1017 or 4.1.1000). For those of you that need an immediate fix to get it working on your UTF-8 site, you can do so by opening "highlight.js" in a text editor, and locating these lines:

            Code:
                text=text.replace&#40;/•/g, ''&#41;;
                text=text.replace&#40;/…/g, ''&#41;;
            And replacing them with:

            Code:
                eval&#40;"text=text.replace&#40;/•/g, ''&#41;"&#41;;
                eval&#40;"text=text.replace&#40;/…/g, ''&#41;"&#41;;
            Note: Please use copy+paste. There are special characters in those lines which you can not easily type with a keyboard.
            --Ray
            Wrensoft Web Software
            Sydney, Australia
            Zoom Search Engine

            Comment


            • #7
              It now works fine.

              We can sometimes be so oblivious to the obvious!

              Now sorted.

              Thanks for all your help.

              Great software, great support

              Thanks

              Mike

              Comment

              Working...
              X