Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Asset has suddenly started to print JS inline...
  • Hi, I'm in the middle of building an app with Fuel. I've been using Asset from the beginning to load external JS and CSS as external files. Now, today, I'm suddenly finding that Asset is printing any local JS files inline. I can't understand why this has started happening - can anybody help? The following, for instance, will load jquery as an external script, but prints out the contents of app.js - which I don't want! <?php echo Asset::js(array('https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js', 'app.js')); ?> Thanks, Matt
  • If this behaviour suddenly started, the first question is: what did you change in the application or your FuelPHP installation? When I paste that code in the welcome/index view of a new FuelPHP installation, it works as advertised:
    < script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"><; /script>
    < script type="text/javascript" src="http://fueltest1.catwoman.exite.local/assets/js/app.js?1327591973"><; /script>
    
  • Thanks for the response... I know the code I pasted works as advertised (normally - it has been for weeks), but obviously something has changed and I can't think what it might be. I mean, is there a setting or condition somewhere that will make JS output inline *by default*?
  • No, there isn't. The inline inclusion is triggered by the third parameter of the js() method. I went through the code (1.1/develop branch) and there isn't a single line of code that alters the value of that parameter. Which version of FuelPHP are you on?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion