任何人都可以請告訴我如何在Spring MVC控制器中獲取javascript變量值。如何將JavaScript變量傳遞給Spring mvc控制器
var countrySelection = "Country Selection List:\n\n";
for (var i = 0; i < frm.selectedCountryItems.length; i++)
if (frm.selectedCountryItems[i].checked){
countrySelection = countrySelection + frm.selectedCountryItems[i].value + "\n";
}
alert(countrySelection);
我想通過價值countrySelection到控制器
你想使用AJAX或者是表單提交的這一部分? – woemler