When I refresh a page, browsers retain the scroll position of the page if there is a #
in the URL, How to over ride this behavior and scroll to the top of the screen without using JavaScript.
My URL is like http://开发者_开发百科example.com/#
Update
By default the URL is http://example.com/
and the # character is added to the URL upon clicking some part of the page.
In case you have a <form action="#" ...>
somewhere, that's your culprit. Change it to <form action="" ...>
.
Anyway you have a # symbol either in form action or in link href.
Replace # with javascript:;
in links.
Replace # with index.php
or leave blank (<form action=""...
) in forms.
精彩评论