I am not sure how to ask this question but I will give it a try.
I have what I consider to be a standard call to an external javascript program within a dynamically created web page.
I want to pass some variables into the JavaScript program, I know I can assign global vars but that looks a bit inefficient.
Can this be done in a similar manner to Perl's query process.
eg.
If so, what is the syntax for recovering the data within the JavaScript program?
I have searched for a solution to this but everything I have found refers to passing vars to functions rather than what I am trying to do.
Keith
I have what I consider to be a standard call to an external javascript program within a dynamically created web page.
Code:
<script type="text/javascript" src="[URL unfurl="true"]http://www.myscript.js"></script>[/URL]
I want to pass some variables into the JavaScript program, I know I can assign global vars but that looks a bit inefficient.
Code:
<script type="text/javascript">var var1 = v1;</script>
<script type="text/javascript">var var2 = v2;</script>
Can this be done in a similar manner to Perl's query process.
eg.
Code:
<script type="text/javascript" src="[URL unfurl="true"]http://www.myscript.js?var1=v1&var2=v2"></script>[/URL]
I have searched for a solution to this but everything I have found refers to passing vars to functions rather than what I am trying to do.
Keith