Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6769249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:10:14+00:00 2026-05-26T15:10:14+00:00

This is driving me insane, this is HTML code. <html> <head> <script> function init()

  • 0

This is driving me insane, this is HTML code.

<html>
    <head>
        <script>
        function init() {
            console.log("fire once");
            window.onhashchange = function() {
                console.log(location.hash);
            }
        }
        </script>
    </head>
    <body onload="init();">
        <a href="#t1">T1</a>
        <a href="#t2">T2</a>
    </body>
</html>

Steps to reproduce bug (bug I believe), open console, click T1, click T2, click back, click back… on Firefox this is console output (I have append mouse action inside []).

[load]
fire once
[click T1]
#t1
[click T2]
#t2
[click back]
#t1
[click back]
(an empty string)

On Google Chrome 14.0.835.202 (tested on Ubuntu and Windows XP), this is output.

[load]
fire once
[click T1]
#t1
[click T2]
#t2
[click back]
fire once
#t1
#t2
#t1
[click back]
fire once
#t1
#t2
#t1
(an empty line)

Safari does not reproduce this bug, so maybe this is V8 bug? how the hell did Google Chrome went through two years with this bug? and most importantly how do I prevent it?

Thanks everyone.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:10:14+00:00Added an answer on May 26, 2026 at 3:10 pm

    The onload event is not being fired again. You’re seeing the output from the time when you clicked T1 and T2. Chrome does not refresh the console when you navigate the same page via clicking # links or the back button.

    EDIT: Okay, I may have misunderstood by what you meant by the []. If the final output you get in the console is

    fire once
    #t1
    #t2
    fire once
    #t1
    #t2
    #t1
    fire once
    #t1
    #t2
    #t1
    <empty>
    

    then this appears to have been fixed in the latest Dev version 17 I checked on (although it also works fine on an ancient Chromium 12 I had lying around). I haven’t checked on the stable Chrome 15.

    If instead, you mean that the final output in the console is only the last five lines of that, then the reason is as I gave in my answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is driving me insane. I have a JS file that is: Ext.onReady(function(){ Ext.QuickTips.init();
This is driving me insane! Here's the code: public static void main(String[] strings) {
Any help most appreciated, this is driving me insane. I'm doing exactly what I
This is driving me absolutely insane. I know that, to change the formatting of
This is driving me nuts. I am using some 3rd-party code in a Windows
I have this problem that is driving me insane. I have a project to
This has been driving me insane. I can't seem to get the RewriteMap directive
This is driving me insane. I am trying to get a basic Report to
This is driving me insane. I am trying to grab an object in javascript
This is driving me insane. how can i achieve the same effect like the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.