我写了下面的javascript函数
function getval(sel)
{
window.location.href = "Posts?Category=<%= sel %>";
}
但是查询字符串中不考虑sel变量的值..
取而代之的是像下面这样的值。
...../Post/Posts?Category=%3C%=%20sel%20%%3E
谁能帮帮我???
最佳答案
因为javascript不理解jsp scriptlet,
尝试,
window.location.href = "Posts?Category=" + sel;
关于javascript - 如何在 window.location.href 中传递 QueryString?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17653110/