05-解决方案
4.1.2 解决方案
(function($) {
$(document).ready(function() {
$('a')
.filter(function() {
var href = $(this).attr('href');
//规范化URL
if ( !jQuery.support.hrefNormalized ) {
var loc = window.location;
href = href.replace( loc.protocol + '//' + loc.host + loc.pathname,
'');
}
// 这个锚标记的形式为<a href="#hash">
return ( href.substr(0, 1) == '#' );
})
.click(function() {
// 特殊单击处理程序代码
});
});
})(jQuery);