When I put www.test.com#view_comments in the URL I want to so show a div not by clicking anything, just by entering it into the URL bar.
Can anyone help开发者_开发百科?
This will only work when the page first loads:
$(document).ready(function() {
if(window.location.hash == '#view_comments') {
$('.comments').show();
}
});
精彩评论