Use PHP in javascript - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Other (
https://sampforum.blast.hk/forumdisplay.php?fid=7)
+--- Forum: Everything and Nothing (
https://sampforum.blast.hk/forumdisplay.php?fid=23)
+--- Thread: Use PHP in javascript (
/showthread.php?tid=545301)
Use PHP in javascript -
Banditukas - 07.11.2014
I have file in extand .js. And i need go to to my php file and do some things and then continious what is next in my .js file.
Re: Use PHP in javascript -
Mauzen - 07.11.2014
I dont know much about JS, but i know that it is client-sided, and PHP is server-sided. This limits the possible communication between them, probably you can only do this by calling the php URL on the server from JS and parse the output.
Re: Use PHP in javascript -
Banditukas - 07.11.2014
What this look in code?
Re: Use PHP in javascript -
GWMPT - 07.11.2014
Use
AJAX to handle the output of remote PHP scripts, process them, and give the required output(if any).
Re: Use PHP in javascript -
Kaperstone - 07.11.2014
or just add the <script></script> tags ...
It outputs html, html proccess js code between <script> tags then add the tags and it will proccess the javascript code ...
Works perfectly for me.
Re: Use PHP in javascript -
Banditukas - 08.11.2014
You mean
function()
{
<script src="url"></script>
}