Javascript, pass value from vbscript scripted-javascript to a function in javascript file?
Apologies for the confusion,
I have two files, one vbscript/asp(classic) and the other a javascript file.
Ive created some g开发者_JAVA技巧oogle API tables in the vbscript and because of this i scripted the javascript functions in the vbscript file ie:
response.write "function DrawGoogleGraph(){" & vbcrlf
etc
everything is working, but i want to now use a value i collect in the vbscript-scripted-javascript function to pass into a function which is in my .js file. It doesnt seem to allow this.
I have surrounded the vbscript-scripted javascript with the tags so i guess it is out of scope?
How can i get around this? I cant really move the Google stuff into my Javascript function and my Ajax calls are all set up in my .js files.
Output a script block in your page that sets the variables for your .js file:
%>
<script type='text/javascript'>
var something = <%=vbSomething%>
</script>
<%
精彩评论