We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32942
    • 141 Posts
    Hi!

    got a lil question fellaz.
    Is Javascript enabled in Snippets? Cuz some lil tests failed.. don’t know why. It worked with 0.9.2 but not with 9.5RC2 am confused..
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Snippets are PHP code. You can either have the php code output the javascript text
      echo '<script type="text/javascript">... code here ... </script>';
      

      or put the javascript in an external .js file and include it with $modx->regClientStartupScrip($filename) to put the javascript include in the head, or $modx->regClientScript($filename) to put it in the body before the closing body tag.
        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