View Single Post
Old 02-13-2013, 08:57 PM   PM User | #6
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,451
Thanks: 0
Thanked 496 Times in 488 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Quote:
Originally Posted by Catalin View Post
I've solved the problem. In the Javascript code was a short .php code inserted. I've deleted the .php and now everything work fine
If you want to include some PHP code in an external JavaScript then give the file a PHP extension and use PHP to add a header to the file:

Use the following if you need to support IE8 and earlier

header('Content-type: text/javascript');

or the following to set the correct JavaScript MIME type if you only need to support browsers that understand JavaScript

header('Content-type: application/javascript');
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote