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

前端 未结 4 1712
孤街浪徒
孤街浪徒 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:16

    No - the query will be ran once on the server, and the JavaScript will call an empty function.

    Note, you should be using just message there, otherwise JavaScript's eval() is being called internally.

提交回复
热议问题