我想调用一个点击事件,然后按照href url。jQuery点击事件第一,然后按照网址
HTML链接:
<a class="autoSave" href="?year=2013&week=42">←</a>
JS:
$(document).ready(function() {
$('.autoSave').click(function(event){
event.preventDefault();
$('.submitForm').click(); //HTML Form that I'm wanting a submit to happen
window.location = $(this).attr('href');
});
});
上面的代码将只需按照网址,而不是提交表单。如果我省略了window.location调用,则提交工作。
是您的形式标准POST/GET HTML形式,或者它有一个基于AJAX的POST方法? –
我的表单是标准POST – user1040259