How to pass the variable value of JS to the ASP variable _javascript skill

Source: Internet
Author: User
ASP as the main page, external to a JS, I would like to know if you can call the ASP in JS variable value, if you can these values are how to pass the past?

I do, do not know is not right? In ASP here: <script type= "Text/javascript" src= Lpindex.js?jsid=trim (Request (' ID ')) ></script> And in JS yonder: location.href= ' Lmsg.asp?id=<%=trim (Request ("Jsid"))%> '; The result is that the resulting ASP variable is simply not available!

The best way is to set up a script code block in the ASP, with <%%> assignment, JS file can not use <%%>, because the ASP parser does not parse JS files, as follows:
HTML Code:
Copy Code code as follows:

<script type= "Text/javascript" >
var a= ' <%=trim (Request ("id"))%> ';///////this code block to be placed in front of Xxx.js
</script>
<script src= "Xxx.js" type= "Text/javascript" ></script>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.