We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25761
    • 12 Posts
    RussiansLoveRockets Reply #1, 19 years, 4 months ago
    Hi, I’ve got $addJscript : 0; in the AjaxSearch snippet, but for some reason, the JavaScripts below get imported twice, and therefore, not working properly. Does anybody know why this would happen? I’ve go the latest version of snippet downloaded and installed (separate from default MODx installation)

    $addJscript = (isset($addJscript ))? $addJscript : 0;

    <script type="text/javascript" src="manager/media/script/scriptaculous/prototype.js"></script>
    <script type="text/javascript" src="manager/media/script/scriptaculous/scriptaculous.js"></script>

    <script type="text/javascript" src="assets/snippets/AjaxSearch/AjaxSearch.js"></script>
    <script type="text/javascript">
    <!--
    stripHtml = 1;
    stripSnip = 1;
    stripSnippets = 1;
    useAllWords = 0;
    searchStyle = ’partial’;
    minChars = 4;
    maxResults = 6;
    showMoreResults = 1;
    moreResultsPage = 8;
    moreResultsText = ’Click here to view all results.’;
    resultsIntroFailure = ’There were no search results. Please try using more general terms to get more results.’;
    extract = 1;
    liveSearch = 0;
    //-->
    </script>
      • 25663 MODX Staff
      • 12,272 Posts
      Hi bne_aus,

      We in fact ran into this this past week and are keenly aware of this. It’s fixed in a commit to the document parser that should be in the SVN trunk if you need it immediately. If you can wait a bit longer, it’ll be in the next patch release (0961).
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me