In my application (using Zend Framework), I have a layout file (layout.phtml) with the <head> section including some javascripts this way:
<head>
// Some code
<?php include('template/javascript.php') ?>
</head>
And in the javascript.php I have:
<?php
print '<script type="text/javascript;
src="'.PASTA_JAVASCRIPT.DS_URL.'jquery'.DS_URL.'jquery.js" ></script>';
print '<script type="text/javascript;
src="'.PASTA_JAVASCRIPT.DS_URL.'application.js" ></script>';
// More code
The thing is, when I use Firefox, all of these scripts are loading correctly and its ready to use. But when using Google Chrome, besides they are being rendered on the html header, I can't use jquery or any other variables I defined on my application.js.
One other point I need to mention is that if I remove the php include code and manually set the scripts inside the <head> tag like the code below, it works like a charm:
<head>
<script type="text/javascript"
src="/path/to/my/scripts/jquery.js"></script>
</head>
All I could think of is some crazy behavior of Php's print/echo or Google Chrome's way of interpreting things... Seriously, I have no idea.
Anyone know what could be possibly causing this behavior?
print '<script type="text/javascript" src="'.PASTA_JAVASCRIPT.DS_URL.'application.js" ></script>';