SA-MP Forums

Go Back   SA-MP Forums > Other > Everything and Nothing

Reply
 
Thread Tools Display Modes
Old 07/11/2014, 05:04 PM   #1
Banditukas
Gangsta
 
Join Date: Jul 2014
Posts: 535
Reputation: 1
Default Use PHP in javascript

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.
Banditukas is offline   Reply With Quote
Old 07/11/2014, 05:33 PM   #2
Mauzen
Banned
 
Join Date: Jun 2007
Location: Western Germany
Posts: 5,100
Reputation: 1597
Default Re: Use PHP in javascript

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.
Mauzen is offline   Reply With Quote
Old 07/11/2014, 05:39 PM   #3
Banditukas
Gangsta
 
Join Date: Jul 2014
Posts: 535
Reputation: 1
Default Re: Use PHP in javascript

What this look in code?
Banditukas is offline   Reply With Quote
Old 07/11/2014, 06:00 PM   #4
GWMPT
High-roller
 
Join Date: Nov 2012
Location: Portugal.
Posts: 1,020
Reputation: 287
Default Re: Use PHP in javascript

Use AJAX to handle the output of remote PHP scripts, process them, and give the required output(if any).
GWMPT is offline   Reply With Quote
Old 07/11/2014, 08:29 PM   #5
Kaperstone
Banned
 
Join Date: May 2011
Location: Russia
Posts: 3,348
Reputation: 824
Default Re: Use PHP in javascript

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.
Kaperstone is offline   Reply With Quote
Old 08/11/2014, 05:44 AM   #6
Banditukas
Gangsta
 
Join Date: Jul 2014
Posts: 535
Reputation: 1
Default Re: Use PHP in javascript

You mean

function()
{
<script src="url"></script>
}
Banditukas is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
unity3D, javascript Baboon Everything and Nothing 5 17/02/2014 05:19 PM
PHP, Javascript cnoopers Everything and Nothing 5 27/12/2013 09:03 PM
[Off] Iniciando em Javascript ipsBruno Português/Portuguese 43 31/03/2013 06:03 AM
PHP to JavaScript covert? sciman001 Scripting Help 16 05/11/2011 07:38 PM


All times are GMT. The time now is 10:57 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.