문제

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