0
我需要從JavaScript函數是在標籤在JSP中,形成如何將JavaScript函數中的值(在<head>中)傳遞給JSP表單<body>?
以下的值是代碼:
function computeTotalDistance(result) {
var total = 0;
var myroute = result.routes[0];
for (var i = 0; i < myroute.legs.length; i++) {
total += myroute.legs[i].distance.value;
}
total = total/1000.
// **total** this is the value i need to get
}
這是身體的形式,
<form:form method="POST" action="${saveReceiptUrl}"></form:form>
我需要在總體變量中獲得這個值,這個表單怎麼做?
存儲在cookie並且得到從JSP中的cookie。 – Anusha