We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32963
    • 1,732 Posts
    Hello Adam,

    The quickedit modules seems to be inserting all the javascripts as one block of code:

    <!-- Start QuickEdit headers -->
    <script type="text/javascript">
    var modId = ’1’;
    var managerPath = ’/netvider/rtsda/manager/’;
    var modPath = ’assets/modules/quick_edit’;
    </script>
    <script src="assets/modules/quick_edit/javascript/cookies.js" type="text/javascript"></script>
    <script src="assets/modules/quick_edit/javascript/output.js" type="text/javascript"></script>
    <script type="text/javascript" src="manager/media/script/scriptaculous/prototype.js"></script>
    <script type="text/javascript" src="manager/media/script/scriptaculous/scriptaculous.js"></script>
    <link type="text/css" rel="stylesheet" href="assets/modules/quick_edit/styles/output.css" />
    <!-- End QuickEdit headers -->

    Inserting all the <script> tags at once will prevent the detecting duplicate script tags. For example the ticker.js now makes use of prototype.js. If it’s also included on a page will result in prototype.js being loaded twice.

    It’s best to register your <script src=""> tags separately.
      xWisdom
      www.xwisdomhtml.com
      The fear of the Lord is the beginning of wisdom:
      MODx Co-Founder - Create and do more with less.
      • 1764
      • 680 Posts
      Quote from: xwisdom at Jan 05, 2006, 12:54 PM

      The quickedit modules seems to be inserting all the javascripts as one block of code:

      Inserting all the <script> tags at once will prevent the detecting duplicate script tags. For example the ticker.js now makes use of prototype.js. If it’s also included on a page will result in prototype.js being loaded twice.

      It’s best to register your <script src=""> tags separately.

      I’m not sure I’m following you. What exactly do you mean by "register your <script src=""> tags separately?

      I can understand that it is a good idea to not have to include files twice but I guess I’m not understanding how to avoid that.
        • 32963
        • 1,732 Posts
        Something like:


        $modx->regClientStartup('<script src="manager/media/script/scriptaculous/prototype.js"></script>');
        $modx->regClientStartup('<script src="manager/media/script/scriptaculous/scriptaculous.js"></script>');
        // etc
          xWisdom
          www.xwisdomhtml.com
          The fear of the Lord is the beginning of wisdom:
          MODx Co-Founder - Create and do more with less.
          • 1764
          • 680 Posts
          Ahhh, I see what you mean.

          Are the regClient functions working post caching now? That was the reason I did not use them initially.

          Do the recClient scripts actually check for duplicates? That would be a good idea. Of course that would be pretty difficult to figure out since absolute and relative URLs and all sorts of other things could easily throw it off.
            • 32963
            • 1,732 Posts
            it does in someways. We don’t want to get too complex in trying to find check for duplicates as it might slow down the parser if too much files are being registered
              xWisdom
              www.xwisdomhtml.com
              The fear of the Lord is the beginning of wisdom:
              MODx Co-Founder - Create and do more with less.