Domanda

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;
?>
È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top