简体   繁体   English

如何将价值从经典的ASP传递给JavaScript

[英]How to pass value from classic asp to javascript

I am new to classic asp. 我是经典ASP的新手。

An asp page gets the urlparameters and depending on the url parameters it calls and loads the appropriate html pages. 一个ASP页面获取urlparameters,并根据其调用的url参数并加载适当的html页面。

I need to display some of the url parameters in the html page, which needs to be passed from the classic asp page? 我需要在html页面中显示一些url参数,需要从经典的asp页面传递这些参数吗? How can it be achieved? 如何实现?

Since you asked about JavaScript, here is a rough example: 由于您询问过JavaScript,因此这里是一个粗略的示例:

<script type="text/javascript">
    alert('URL parameter value is: <%=Replace(Request.QueryString("paramnamehere"), "'", "\'")%>');
</script>

Replace "paramnamehere" with the name of the URL parameter and you'll see its value as client side alert dialog. 将“ paramnamehere”替换为URL参数的名称,您将在客户端警报对话框中看到其值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM