We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33453
    • 141 Posts
    I have defined a chunk {{Amazon Optimising}} like this
    <script type="text/javascript">
      amazon_ad_tag = "affiliateid";
      amazon_ad_width = "728";
      amazon_ad_height = "90";
    </script>
    <script type="text/javascript" src="http://www.assoc-amazon.co.uk/s/ads.js"></script>

    When the page renders I see nothing. View source shows me
    <script type="text/javascript">
      amazon_ad_tag = "affiliateid";
      amazon_ad_width = "728";
      amazon_ad_height = "90";
    </script>
    <!-- pt type="text/javascript" src="http://www.assoc-amazon.co.uk/s/ads.js"></scri-->

    Where the last line has been turned into a comment.

    Any ideas why?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      That is really strange. While I have no answer to your question, I will say that I use a snippet for such things, using the $modx->regClientStartupScript() functions.

          $src1 = '
      <script type="text/javascript">
        amazon_ad_tag = "affiliateid";
        amazon_ad_width = "728";
        amazon_ad_height = "90";
      </script>
          ';
          $src2 = '<script type="text/javascript" src="http://www.assoc-amazon.co.uk/s/ads.js"></script>';
          $modx->regClientStartupScript($src1);
          $modx->regClientStartupScript($src2);
      
        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
        • 32963
        • 1,732 Posts
        Could it be a your host server that’s preventing <script> tags with the src attribute?
          xWisdom
          www.xwisdomhtml.com
          The fear of the Lord is the beginning of wisdom:
          MODx Co-Founder - Create and do more with less.
          • 33453
          • 141 Posts
          Thanks Susan, Raymond.

          You put me on the right track - not the host server but my firewall interfering in non-firewall matters (ad filtering). Grrrr!