Home > Web Front-end > JS Tutorial > How to pass JS variable value to ASP variable_javascript skills

How to pass JS variable value to ASP variable_javascript skills

WBOY
Release: 2016-05-16 17:46:51
Original
2361 people have browsed it

As the main page, asp is connected to a js. I want to know if I can call the variable values ​​​​of asp in js. If so, how are these values ​​​​passed?

This is what I did. Is it correct? Here in asp: And on the js side: location.href= 'lmsg.asp?id=<%=trim(request("jsid"))%>';The result of this is that the obtained asp variable is not used at all!

The best way is to set up a script code block in asp and use <%%> to assign the value. You cannot use <%%> in js files because the asp parser does not parse js files. As follows:
HTML code:

Copy code The code is as follows:



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template