Jump to content

My application's javascript/CSS is loaded only ONCE, then never again


snugRugBug

Recommended Posts

Posted

I'm trying to make my application load some javascript/CSS if my custom template tag is used. Here is my output plugin code:

public static function runPlugin( $data, $options )
{

  foreach( \IPS\Output::i()->js( 'front_browse.js', 'myapp', 'front' ) as $url ){
  	\IPS\Output::i()->endBodyCode .= "<script type='text/javascript' src='".$url."'></script>";
  }

  array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css("myappDefault.css", "myapp", "front"));

  return '\IPS\Theme::i()->getTemplate( "browse", "myapp", "front" )->myAppTemplate( "'.$data.'" )';
}

On my dev install, this works perfectly, but when I move it to the live site, it only loads the javascript/CSS once, and then never again. I can make it load again by deactivating my application, and then reactivating it, but that also just makes it load one more time.

Can someone please explain this behavior, and how to get around it?

The html template is loaded correctly each time, btw.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...