PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Highlighting issue.

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

  • Highlighting issue.

    Hi:

    I am trying to use the Jump to match and highlight within document functionality. It was working fine when I experimented with it, but now it's no longer working after I re-indexed.

    I tried adding the highlight() function in the <body> tag as well as right after the </body> tag in all my HTML pages. Basically followed all the instructions as well as looked at the troubleshooting section, but it has stopped working.

    I do know that the highlight() function is getting called correctly because (just for testing) I added an Alert Box in the highlight() function in highlight.js, and when I click on any HTML page, the Alert Box pops up correctly due to the onload event.

    Any ideas on what I am missing? Ideally, I would prefer to have the highlight() function right after the </body> tag rather than in the <body> tag.

    Things to note:
    1. I am using IE.
    2. I have renamed highlight.js to my naming convention, but as I mentioned earlier, the highlight() function within this renamed file is correctly getting called.
    3. I have appended two new custom JS functions towards the end of the file. Note that I have not touched Wrenexisting code in highligh.js.

    Thanks,
    K
    Last edited by kutra; Jul-09-2008, 10:44 PM.

  • #2
    It's hard for us to comment without seeing the page and code in question. Given your description, my guess would be that your other Javascripts running on the same page are conflicting with the functionality of the highlighting script. You can isolate this by removing the other JS temporarily (use a copy of the page or make a backup) and see if the problem goes away.
    --Ray
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine

    Comment


    • #3
      Thanks for your reply.

      I separated my custom code and put it in a different JS file. Now highlighting also works and so does my custom JS implementation.

      Any idea what's causing the conflict? Here's how my custom JS file looks:

      -----------------------------------------------------------------------
      //
      // The unCheckOnlyAll() function unchecks the "All" check box when any
      // other check box is checked.
      //
      function unCheckOnlyAll()
      {
      document.searchForm.zoom_catAll.checked=false;
      }
      //
      // The unCheckAllOthers() function unchecks all other check boxes when
      // the "All" check box is checked.
      //
      function unCheckAllOthers()
      {
      document.searchForm.zoom_cat0.checked=false;
      document.searchForm.zoom_cat1.checked=false;
      document.searchForm.zoom_cat2.checked=false;
      }
      //

      -----------------------------------------------------------------------

      These functions are called from the search_template file which has this code:

      <form method="get" name ="searchForm" action="search.cgi" class="zoom_searchform">
      Search for: <input type="text" name="zoom_query" size="20" value="" class="zoom_searchbox" />
      <input type="submit" value="Submit" class="zoom_button" />
      <span class="zoom_results_per_page">Results per page:
      <select name='zoom_per_page'><option selected="selected">10</option><option>20</option><option>50</option><option>100</option></select><br /><br /></span>
      <span class="zoom_categories">
      Category: <ul>
      <li><input type="checkbox" name="zoom_catAll" value="-1" onClick="unCheckAllOthers()" checked="true">All</input></li>
      <li><input type="checkbox" name="zoom_cat0" value="0" onClick="unCheckOnlyAll()">Exclude References</input></li>
      <li><input type="checkbox" name="zoom_cat1" value="1" onClick="unCheckOnlyAll()">Reference A</input></li>
      <li><input type="checkbox" name="zoom_cat2" value="2" onClick="unCheckOnlyAll()">Reference B</input></li>
      </ul><br /><br />
      </span>

      Regards,
      K

      Comment


      • #4
        I created a test page with the above code on it, and using the highlight script, and it had no problems and highlighted the words correctly. Perhaps you best give us a link to the page in question. You can email us this if you wish to keep it private.

        If there is some other intrinsic conflict, we may also be able to provide you with a beta version of the new highlight script we have for V6 which has proven thus far to be compatible with more Javascripts.
        --Ray
        Wrensoft Web Software
        Sydney, Australia
        Zoom Search Engine

        Comment


        • #5
          Ray, thanks for your reply. We have decided to forego the use of custom JS code for this release since this forces us to generate our own search form rather than use ZoomSearch's auto-generated form.

          This is because we wanted the search results page to retain the keyword in the search text box. And also, not have the categories reset to All each time.

          Regards,
          K

          Comment


          • #6
            Originally posted by kutra View Post
            Ray, thanks for your reply. We have decided to forego the use of custom JS code for this release since this forces us to generate our own search form rather than use ZoomSearch's auto-generated form.

            This is because we wanted the search results page to retain the keyword in the search text box. And also, not have the categories reset to All each time.

            Regards,
            K
            Ray/Wrensoft:

            Will the next version of ZoomSearch remove this restriction? If yes, when is the next version due?

            Thanks,
            K

            Comment


            • #7
              I presume you are referring to the fact that you need to define your own search form for your above modification. Note that the above question is a little vague, because the current version does not prevent custom JS code to be used with a form, if said JS code does not require the form to be modified.

              Given that, yes, V6 will feature advanced template options, so you can customize the search form further without modifying the search script.

              In this case, you can define SOME elements of the search form to be generated by the search script, and SOME elements you can define yourself. For example, your above form may look like this in V6:

              Code:
              <!--ZOOM_SHOW_FORMSTART-->
              <!--ZOOM_SHOW_SEARCHBOX-->
              <!--ZOOM_SHOW_SEARCHBUTTON-->
              <!--ZOOM_SHOW_RESULTSPERPAGE-->
              <span class="zoom_categories">
              Category: <ul>
              <li><input type="checkbox" name="zoom_catAll" value="-1" onClick="unCheckAllOthers()" checked="true">All</input></li>
              <li><input type="checkbox" name="zoom_cat0" value="0" onClick="unCheckOnlyAll()">Exclude References</input></li>
              <li><input type="checkbox" name="zoom_cat1" value="1" onClick="unCheckOnlyAll()">Reference A</input></li>
              <li><input type="checkbox" name="zoom_cat2" value="2" onClick="unCheckOnlyAll()">Reference B</input></li>
              </ul><br /><br />
              </span>
              <!--ZOOM_SHOW_FORMEND-->
              Note that this is only an example to illustrate how V6 will work. Actual syntax may change by the final release (in case people find this thread after V6 is released, and the behaviour of the above tags has changed). Note also that V6 is a free upgrade for people who purchase V5.1 now.
              --Ray
              Wrensoft Web Software
              Sydney, Australia
              Zoom Search Engine

              Comment


              • #8
                I was referring to the disadvantages of generating my own search form.
                1. The search results will clear away the keyword entered in the search field.
                2. The selected category checked box defaults to ALL.

                Regards,
                K

                Comment


                • #9
                  1. No, it will not clear away with the abovementioned method in V6. This is because you're selecting which parts of the form you wish to have auto-generated, and which to not.

                  2. The category checkboxes will work the same way. Again, the problem is that any different behaviour such as what you did, requires the addition of Javascript on the search page. As you have seen, providing Javascript is problematic, when users commonly insert many different JS on the same page without understanding how they work (it is a trend to just copy+paste scripts on the web), and conflicts between scripts are bound to occur. We try to avoid providing JS for this reason.
                  --Ray
                  Wrensoft Web Software
                  Sydney, Australia
                  Zoom Search Engine

                  Comment

                  Working...
                  X