I am wondering whether is it possible to pass any variable to external java-script file
For example
I have this
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.