我有这行代码在我的页面中的 ddl 更改时执行 -
location.href = '@Url.Action("Edit", "Page", new { UserId = (string)null })/' + '@ViewBag.userId' + '?status=' + '@ViewBag.status' + '&pageNo=@ViewBag.PageNo';
该链接仅使用 & 即可正常工作,但在检查标记验证器http://validator.w3.org/check后,它建议我将 & 替换为&
; 我已经在上面的代码行中这样做了。但是现在,当我更改 ddl&
字面显示在 url 中并且页面无法正常工作(由 ddl 过滤)。
<script type="text/javascript">
$(document).ready(function () {
$(".ddl").change(function () { changePage(); });
});
function changePage() {
location.href = '@Url.Action("Edit", "Page", new { UserId = (string)null })/' + '@ViewBag.userId' + '?status=' + '@ViewBag.status' + '&pageNo=@ViewBag.PageNo';
}
</script>
有人可以告诉我我做错了什么吗?