问题
I have a jQuery-powered cost calculator, and I want to allow the webpage to send a summary of the calculator's values in an email. The server runs on classic ASP.
How do I retrieve javascript variables with ASP?
I understand that the ASP code runs before the page loads, and the javascript code runs only after the page is loaded, since the javascript is not runat="server".
How can I store javascript variables so that I can retrieve them with ASP code on a processing page?
calculator with Javascript --> form action = "process.asp" --> ASP to pick up javascript values
College Cost Calculator
回答1:
Another solution is to set the values of the javascript variables to hidden form fields. Submit the form and read the form values on the server-side. After reading the values, create and send the email.
回答2:
use http://api.jquery.com/jQuery.ajax/ or http://api.jquery.com/jQuery.post/ to send the information to process.asp
来源:https://stackoverflow.com/questions/10838067/send-javascript-variable-to-classic-asp