We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • It would be nice to know exactly which libraries are needed to be included in the template head. Even after copying all five javascript tags from the default template’s head, I’m still getting a "liveSearch is not defined" error.

    Ah, I see the problem... the regClientStartupScript isn’t working. Ok, that I can deal with!
      Studying MODX in the desert - http://sottwell.com
      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
      Join the Slack Community - http://modx.org
      • 18666
      • 8 Posts
      This is for AjaxSearch 1.0 as of 19th August 2006.

      For those getting the following error alerts
      Exception AJAX: $(element) has no properties

      Exception AJAX: Object required


      2 ways to get around them.

      no.1
      Just comment out or remove line 115 in AjaxSearch.js
      new Effect.Fade('ajaxSearch_intro',{duration:.3, queue: 'front'});


      or no.2
      just set
      &AS_showResults=`1`


      And it should work.

      It seems that the "ajaxSearch_intro" element wasn’t defined and therefore will throw the exception when called.
        • 27889
        • 415 Posts
        Hello, this snippet is awesome, but I can’t do what I want:

        I placed the form in my template like this:
        <div id="recherche">
        [!AjaxSearch? &AS_landing=`10` &AS_ShowResults=`0` &ajaxSearch=`0`!]
        </div>
        In the content of my search page (id=10) I have that call:
        [!AjaxSearch? &extract=’1’ &ajaxMax=’7’ &AS_ShowResults=’1’ &AS_ShowForm=’0’!]

        When I try to make a search the results are displayed in both place, the template and the body, the form is displayed on the too place too, like the snippet ignore the parameters.
        The search page is uncached and my doctype for the template is xhtml strict.
        I don’t know what I’m doing wrong, perhaps someone could help me ?
          MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
          MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
        • I see that in your snippet call on your "landing" page you used ’ ’ marks instead of ` ` backticks...
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 27889
            • 415 Posts
            Thanks for your reply, but the same occurs with both.
            Its like parameters are ignored
            When I modify parameter I reload the site, and erase the cache of my navigator but the page showed is always the same until I logout the manager.
            with [!AjaxSearch!] I have the error: EXCEPTION AJAX:malformed URI sequence but sometimes it work
            if no results is found I haven’t any error.

            My url are http://localhost:85/modx/accueil.html, perhaps it is the problem ?
              MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
              MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
              • 15987
              • 786 Posts
              The whole snippet call on the landing page needs to use backtics (`) instead of (’)

              [!AjaxSearch? &extract=`1` &ajaxMax=`7`  &AS_ShowResults=`1` &AS_ShowForm=`0`!]
                • 27889
                • 415 Posts
                I know that Kyle, but as I explained to Susan, the both ’ and ` are doing the same result
                  MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
                  MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
                  • 15987
                  • 786 Posts
                  ok, wasn’t sure if you had changed both of them.

                  So is the snippet working just not accepting the parameters or are you getting an error?

                  If you have a place you could put this onlince I would be happy to look at it for you.

                    • 27889
                    • 415 Posts
                    The problem with parameter seems to be a cache problem, I logout relogin in the manager and changes occurs.

                    Now I’m trying a simple call:
                    [!AjaxSearch!]

                    and I have an ajax exception : malformed URI sequence.
                    If I try a word which doesn’t exit on my site I have no exception.


                    My url are like that: http://localhost:85/modx/
                      MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
                      MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
                      • 15987
                      • 786 Posts
                      I think I found the error, try this:

                      [!AjaxSearch? &AS_landing=`10` &AS_showResults=`0` &ajaxSearch=`0`!]


                      [!AjaxSearch? &extract=`1` &ajaxMax=`7`  &AS_showResults=`1` &AS_showForm=`0`!]


                      the parameters do not have a capital S in them

                      This discussion is closed to further replies. Keep calm and carry on.