Is it possible to pass GET or POST variable to external javascript

后端 未结 4 1076
广开言路
广开言路 2021-01-26 08:08

I am wondering whether is it possible to pass any variable to external java-script file

For example

I have this

4条回答
  •  孤街浪徒
    2021-01-26 08:30

    You don't "pass variable to external script", instead you download the script, and pass the variable with regular function call, executing the script in the client machine.

    If the javascript code is meant to be executed in the server, then you can either use a database to hold the values temporarily or use server-side javascript

    If the javascript code is meant to be executed by a third party, unrelated to either the client or host, then you will have to store the values in a database.

提交回复
热议问题