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;
?>
有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top