Question

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;
?>
Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top