We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53155
    • 5 Posts
    Hello!
    I have been developing a search engine for some templates of my site, I need to use ajax mode, I have searched information about it, and there is not enough information.

    My trouble is the folowing:

    I have this code in search form:
    [[!AdvSearchForm? &landing=`35` &help=`0` &clearDefault=`1` &withAjax=`1` &ajaxResultsId=`537` &addCSS=`0` &liveSearch=`1`]]


    Where Landing is for normal search and ajaxResultsId (document id) is for searching by ajax mode

    And I have this code in document content (537):
      [[!AdvSearch? &hideContainers=`1` &fields=`pagetitle` &hideMenu=`0` &withFields=`pagetitle` &perPage=`20` &sortby=`pagetitle[ASC]` &minChars=`3` &ids=`[[!GetOnlyChildren]]` &withAjax=`1`]]
    

    Where the snippet GetOnlyChildren returns ids where the search will be made.

    And I found some script I added:

    <script type="text/javascript">
      //<![CDATA[
        advsea[advsea.length]='{"asid":"as0","hid":"537"}';
      //]]>
      </script>


    So, this is the mistake when the keypress event is done:
    Uncaught ReferenceError: URI is not defined
    at doSearch (advsearch.min.js?_=1484750863:8)
    at advsearch.min.js?_=1484750863:8

    Any Suggestion?

    Thanks
      • 36798
      • 4 Posts
      Hi zara2ua,

      You need to load - URI.min.js
      Try adding &useHistory=`1` to the call.
      Use &addJs
      (Opt: 0 | 1 | 2)
      0: not included. You should add them manually.
      1: included before the closing HEAD tag
      2: included before the closing BODY tag
      Def: 1


        lanceC