$(document).ready(function() {
var hash = window.location.hash;
var link = $('a');
$('a').click(function(e) {
e.preventDefault();
hash = link.attr("href");
window.location = hash;
});
});
You also have to specify event argument in the function. By naming it as e
or event
and then you can manipulate it.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…