Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I pass a classic asp variable to JS

Status
Not open for further replies.

penguinspeaks

Technical User
Nov 13, 2002
234
0
16
US
How do I show a classic asp variable in a javascript link??
Code:
<script>
var variable = <%=varid%>
window.open("[URL unfurl="true"]https://ferrens.info/MUSIC/PDF2.ASP?id="+variable);[/URL]

</script>

I have tried
Code:
<script type='text/javascript>
var variable = '<%=variable%>';
</script>

But it will not allow me to close the script tag with the asp in the script. It shows yellow in Expression.

I have been pulling hair out, teeth out, and everything else on this.

Ideas??
TIA




Thanks,
Penguin
Please keep in mind that I am using classic ASP with MySQL database. Not sure if that information helps or not.
 
Have you tried
Code:
<script>
var variable = <%=varid%>
window.open("[URL unfurl="true"]https://ferrens.info/MUSIC/PDF2.ASP?id=<%=varid%>");[/URL]
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top