我试图通过点击这样的按钮重定向到新的jsp页面:
<script type="text/javascript">
$(document).ready(function() {
$("input[type=button]").click(function () {
var x=$(this).siblings("input[type=text]").val();
$('#selectedempids').val(x);
alert("Would submit: " + x);
loaction.href='ProjectAssigning.jsp';
});
});
</script>
在html中我有类似的东西:
<div>
<h1 align="center">ASSIGN PROJECTS</h1>
Assign Project To : <input type="text" id="demo-input-facebook-theme" name="blah2"></input>
<br></br>
<input type="hidden" name="selectedempids" id="selectedempids"></input>
Project Name : <input type="text" name="projecttitle" id="projecttitle"></input>
<br></br>
Project Description : <input type="file" name="description" id="description"></input>
<br></br>
<input type="button" value="Submit" />
<script type="text/javascript">
$(document).ready(function() {
$("#demo-input-facebook-theme").tokenInput("ValidEmployeeList.jsp", {
theme: "facebook"
});
});
</script>
</div>
但它没有被重定向。请帮助我知道原因。
答案 0 :(得分:0)
而不是:
loaction.href = 'ProjectAssigning.jsp';
使用此:
window.location.assign('ProjectAssigning.jsp');