The jQuery method completely ignores href
:
$('#google_link').click(); // ignores href!
The native DOM method does the right thing:
$('#google_link')[0].click();
This works regardless of whether the href
is a URL, a fragment (e.g. #blah
) or even a javascript:
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…