divinedesigns1 Posted February 7, 2019 Share Posted February 7, 2019 if I have a PHP function can I call it in a javascript function? I am pulling the information from a database using PHP? or do I have to use java for this? Link to comment Share on other sites More sharing options...
justsomeguy Posted February 7, 2019 Share Posted February 7, 2019 One of them runs in the browser and one of them runs on the server, so no. What you can do is create an ajax request in Javascript and send it to the server with whatever data you want to send to tell the server what to do, and the server sends the response back. 1 Link to comment Share on other sites More sharing options...
divinedesigns1 Posted February 8, 2019 Author Share Posted February 8, 2019 6 hours ago, justsomeguy said: One of them runs in the browser and one of them runs on the server, so no. What you can do is create an ajax request in Javascript and send it to the server with whatever data you want to send to tell the server what to do, and the server sends the response back. so use the ajax to get the information from the php to then call the ajax in javascript? if i understand correctly, thanks Link to comment Share on other sites More sharing options...
justsomeguy Posted February 8, 2019 Share Posted February 8, 2019 Ajax is using Javascript to send a request to the server. So you send whatever data you need to send to the server, the server gets the data and does whatever you want to do there, and you send any data you might want back to Javascript. Link to comment Share on other sites More sharing options...
divinedesigns1 Posted February 10, 2019 Author Share Posted February 10, 2019 On 2/7/2019 at 8:11 PM, justsomeguy said: Ajax is using Javascript to send a request to the server. So you send whatever data you need to send to the server, the server gets the data and does whatever you want to do there, and you send any data you might want back to Javascript. thanks, sorry for the late reply Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now