1

Win7 x64 / Chrome

When clicking a link to a question on SO, the subsequent page will jump/scroll down a screen or so when the page loads. Sometimes this behavior occurs all of the time, while other times the behavior does not exist; I can't seem to find anything to consistently reproduce this issue.

Example
The original URL on the home page of SO linking to a question is:

http://stackoverflow.com/questions/16892132/loading-multiple-versions-of-dlls#mlsn

Upon clicking the link, the URL becomes trimmed up to the hash, re: the mlsn is stripped:

http://stackoverflow.com/questions/16892132/loading-multiple-versions-of-dlls#

Has anyone else experienced this behavior?

Possible Culprit?
Could this script from the question page be the culprit?
(see end of script: document.location.replace('#');)

<script type="text/javascript">
    StackExchange.using(
        "gps",
        function(){
            if (!/^#ml..$/.test(location.hash))
                return;

            if(document.location.hash == '#mlsy'){
                StackExchange.gps.track('so qlist.click', { 'new_constant_a': 'y' });
            }

            if(document.location.hash == '#mlsn') {
                StackExchange.gps.track('so qlist.click', { 'new_constant_a': 'n' });
            }

            if (document.location.hash == '#mlsy') {
                $('.post-form').append('<input type="hidden" name="mls" value="y">');
            }

            if (document.location.hash == '#mlsn') {
                $('.post-form').append('<input type="hidden" name="mls" value="n">');
            }

            document.location.replace('#');
        }
    );
</script>
  • I had searched for quite awhile to see if this had been previously reported; looks like I missed the other question. – Metro Smurf Jun 3 '13 at 20:34