我想在javascript函數中讀取jstl變量。在JavaScript代碼中讀取jstl變量。
JS代碼提交表單。
$("#userSubmit").on('submit', function() {
document.getElementById("userForm").submit();
});
所以在服務器代碼 -
request.setAttribute("userId", 435);
,並在頁面加載後 - > JavaScript代碼 -
$("#textBoxInp").keyup(function() {
// I want to access the userId here.
// in html code i can acccess it using JSTL syntax ${userId}
});
你真的不問一個問題 - 你只是有點說你的需要和慾望。 –