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

    Not strictly Modx, but it's in my modx template.... ;-)

    OK, here is the code I have in the <head>:

    <script type="text/javascript" src="assets/templates/js/jquery-1.6.min.js" />
    <script type="text/javascript" src="assets/templates/colorbox/jquery.colorbox-min.js" />
    <script type="text/javascript" src="assets/templates/js/jail.0.9.5.min.js" />
    <script type="text/javascript" >
      $(document).ready(function () {
      $('.gal-item img').asynchImageLoader({placeholder : "assets/templates/colorbox/images/loading.gif"});
      $("a[rel='colorbox']").colorbox();
      });
    </script>
    


    But, the scripts are not being executed, and when I look at the source, only the first script src is a clickable link; the rest of the scripts are (effectively) not being seen. The source looks like:

    <script type="text/javascript" src="assets/templates/js/jquery-1.6.min.js">
    <script type="text/javascript" src="assets/templates/colorbox/jquery.colorbox-min.js" />
    <script type="text/javascript" src="assets/templates/js/jail.0.9.5.min.js" />
    <script type="text/javascript" >
      $(document).ready(function () {
      $('.gal-item img').asynchImageLoader({placeholder : "assets/templates/colorbox/images/loading.gif"});
      $("a[rel='colorbox']").colorbox();
      });
    </script>
    


    You can see that the end tags are not right for the 2nd and 3rd script lines. The browser is seeing the first <script> and the last </script> as the whole element, and I can't see why!!

    Any ideas - have I missed something blatantly obvious??

    Thanks
    Daz
    I've tried switching the lines around, retyping, typing in a raw text editor - all to no avail!
      formerly sumodaz on here!
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      As far as I know, < script > tags can't be self-closing, you always have to have a closing < /script > 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
        • 37449
        • 57 Posts
        Yeah, just found this out!! laugh
          formerly sumodaz on here!