0
votes

I'm having an issue pulling in some external javascript files in my CMP's.

It seems that they completely disappear... they don't even show as being pulled in with Fiddler.

Anyone know how I can get them to pull in properly?

ModX Revolution 2.2.10-pl

and my CMP at this point is simply

<?php
    $ret = '<script type="/assets/scripts/main.js"></script>';
    $ret .= '<script type="/assets/scripts/custom.js?_=' . time() . '"></script>';
    $ret .= '<h1>Hello</h1>';
    return $ret;
?>
1
How to you reference this file? You should have a handler which serves the correct namespace and the js-files.OptimusCrime
no handler... simple action and menuKevin
This snippet is cached?Vasis
not cached, in fact I've gone and made sure to delete the cache/sessions removed all locks, and deleted the cache files from the server just to make sureKevin

1 Answers

1
votes

Needed to add $modx->regClientStartupScript('/path/to/my/script.js'); to my CMP in order for it to work.