忘记href,只需在点击功能中完成所有操作.更新完成后,您可以导航到另一个页面.这是我的JQuery建议:
HTML
JavaScript(带有JQuery)
$("#download").click(function(e){
e.preventDefault();//this will prevent the link trying to navigate to another page
var href = $(this).attr("href");//get the href so we can navigate later
//do the update
//when update has finished, navigate to the other page
window.location = href;
});
注意:我添加了一个标签的id,以确保可以通过JQuery精确地选择