Can php and JavaScript be used in the same page | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can php and JavaScript be used in the same page

30th Jul 2016, 9:53 AM
Stephen Akande
Stephen Akande - avatar
5 Answers
+ 2
Yes. PHP is for server side processing. JavaScript is for client side and runs in the browser.
30th Jul 2016, 4:22 PM
Nathan “Grimston” Pipes
Nathan “Grimston” Pipes - avatar
+ 2
Yes we can use but there is no interaction between the php code and js code js code interacts with the HTML code present in the page
31st Jul 2016, 3:41 AM
Karthik Ponnam
+ 1
of course. if you want to "connect" this languages you can use ajax. google it
1st Aug 2016, 4:45 AM
Rodion Ustimov
Rodion Ustimov - avatar
+ 1
You can use php to create dynamic javascript
1st Aug 2016, 2:45 PM
GlennV
0
If your file extension is .php , you can echo the Javascript. Make sure it is inside <script></script> though.
6th Aug 2016, 4:01 AM
King Tech
King Tech - avatar