View Single Post
Old 11-20-2012, 11:22 PM   PM User | #551
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
Quote:
Originally Posted by Luckyplaya View Post
Code:
<script type="text/javascript">
		var conversionLogLength = 0;

		function updateVideoDownloadProgress
...
This code I would like to put it in a external file for hidden in index.php.
But in this javascript php is also available, so I can not create a js file. If I create a php file and with <script type="text/javascript" src="js/js.php"> views, the converter will not be displayed.
If your javascript has PHP in it (in other words, the PHP is dynamically generating the Javascript), then you have to put it in a PHP or INC file. (I wouldn't use the INC file type unless your application is already using it by convention.)

In your situation it sounds like you will want to include the new PHP file (that contains your javascript) inside of index.php, i.e.:
PHP Code:
// somewhere in index.php
include 'someFolder/myNewFile.php'
__________________
Regards, R.J.
chump2877 is offline   Reply With Quote