I have a question when what is the meaning of an .php file called as Javascript? And when is it necessary to use it?
ex:
& lt; Head & gt; & Lt; Script src = "dir / myphpfile.php" type = "text / javascript" & gt; & Lt; / Script & gt; & Lt; / Head & gt;
This means that myphpfile.php will generate javascript Code as an output instead of HTML because the web browser can understand in a script tag. This is useful in situations when you want to generate dnyamic javascript in runtime instead of coding it in different .js files For example, to declare a JavaScript variable, think about which server But the list of stored customers in the database and making it javascript variable accessible globally. Another common example where this can be useful,
Another example is to use a php script which will combine and cache the output of more than one javascript files together.
Comments
Post a Comment