SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
-
Jan 17, 2003, 06:59 #1
- Join Date
- Mar 2001
- Location
- Philadelphia, US
- Posts
- 2,205
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
External Javascript files parsed by PHP?
Anyone know if external JavaScript files are parsed by PHP, and thus can have PHP variables passed to them through echo()?
-
Jan 17, 2003, 09:57 #2
- Join Date
- Mar 2002
- Location
- Bristol, UK
- Posts
- 2,240
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
No... but you can save them with a .php extension and change the Content Type to JavaScript:
PHP Code:header( "Content-type: Text/JavaScript" );
Hope this helps!
-SamSam Hastings
-
Jan 17, 2003, 10:07 #3
- Join Date
- Mar 2001
- Location
- Philadelphia, US
- Posts
- 2,205
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by Devilware.net
Hope this helps!
-Sam
-
Jan 17, 2003, 10:22 #4
Include it Javascript-style:
Code:<script language="javascript" type="text/javascript" src="generatedJSfile.php"> </script>
-
Jan 17, 2003, 10:24 #5
- Join Date
- Mar 2002
- Location
- Bristol, UK
- Posts
- 2,240
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yeah... sorry, forgot to add that. Just follow vgarcia's advice
-SamSam Hastings
Bookmarks