Welcome Guest, Not a member yet? Register   Sign In
javascript files with php code
#4

(This post was last modified: 10-02-2015, 08:26 PM by JayAdra.)

There are a few different ways to handle this - each have their pros and cons. It depends on preference and your specific requirements really.

This is a great post to refer to for information on each:
http://stackoverflow.com/questions/23740...javascript

I generally do what others have suggested. I have a single <script> element in my <head> which contains all variables I need echoed into JS, which I can then reference anywhere in my other JS files. I use this mostly for language lines, but it has other uses too.
Reply


Messages In This Thread
javascript files with php code - by Lykos22 - 10-02-2015, 09:02 AM
RE: javascript files with php code - by freddy - 10-02-2015, 08:14 PM
RE: javascript files with php code - by JayAdra - 10-02-2015, 08:24 PM
RE: javascript files with php code - by Lykos22 - 10-15-2015, 08:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB