+ 1

How am i suppose to combine js with php

Whats the most correct way to do this? and does php have built in functions like that of onclick for js? because its pretty irritating having to combine php with js just so i can use the onclick function.

15th Jun 2018, 9:55 PM
Mogammad Shameer Losper
Mogammad Shameer Losper - avatar
4 Answers
15th Jun 2018, 10:20 PM
Ben Allen (Njinx)
Ben Allen (Njinx) - avatar
0
Are you using php as an api? because if so you should look into this javascript library called axios. it allows you to make http requests which is normally how you interact with an api. I would also look into javascripts fetch function. I believe it is built in.
15th Jun 2018, 10:21 PM
Haon1919
Haon1919 - avatar
0
Thanks for the replies guys
17th Jun 2018, 12:19 AM
Mogammad Shameer Losper
Mogammad Shameer Losper - avatar
- 1
i really dont know bcs they both are script lang.
16th Jun 2018, 5:44 AM
Ibodullo Salimov
Ibodullo Salimov - avatar