Run PHP code inside JavaScript? Would this be ok to use?

前端 未结 4 1710
孤街浪徒
孤街浪徒 2021-01-21 03:43

I am not sure if a line of PHP could be run inside of a JavaScript function. For example:



        
4条回答
  •  隐瞒了意图╮
    2021-01-21 04:23

    You're getting it the other way around. Your main file is PHP, and the PHP parser will interpret that and create a HTML page out of it, which may or may not contain JavaScript. This file will be sent to the client, and the client will then interpret any JavaScript.

    JavaScript = client side.

    PHP = server side.

提交回复
热议问题