Sykje yn Support

Mij stipescams. Wy sille jo nea freegje in telefoannûmer te beljen, der in sms nei ta te stjoeren of persoanlike gegevens te dielen. Meld fertochte aktiviteit mei de opsje ‘Misbrûk melde’.

Mear ynfo

Dizze konversaasje is argivearre. Stel in nije fraach as jo help nedich hawwe.

Event hashchange and document.title

  • 1 antwurd
  • 1 hat dit probleem
  • 10 werjeftes
  • Lêste antwurd fan Paul

more options

I have a problem with some JavaScript code that is run on a hashchange event.

The code updates the web document, and also the document.title. The document.title is modified last.

If not modifying document.title, everything works fine. If updating document.title, the code sometimes fails, but not always. The symptoms are as follows.

  • The document.title is updated correctly, according to the A-tag with the hash URL that was clicked.
  • The URL field in the browser is not updated to the new value.
  • Non of the other document updates are done, even if they are performed on the code lines before changing document.title.

If a move the mouse outside Firefox and click in another window, the browser URL field is updated and the rest of the document is updated.

I then tried the code in google-chrome. There everything works fine.

If I add a console.log() in the hashchange eventhandler, everything works fine. Another work-around is to use window.setTimeout and delay modification of document.title by e.g. 10ms.

Is this a problem in Firefox, or am I not supposed to modify document.title on the hashchange event?

I am using Firefox 88.01 for Fedora 33.

I guess I should not include HTML and JavaScript in this editor?

I have a problem with some JavaScript code that is run on a hashchange event. The code updates the web document, and also the document.title. The document.title is modified last. If not modifying document.title, everything works fine. If updating document.title, the code sometimes fails, but not always. The symptoms are as follows. * The document.title is updated correctly, according to the A-tag with the hash URL that was clicked. * The URL field in the browser '''is not''' updated to the new value. * Non of the other document updates are done, even if they are performed on the code lines before changing document.title. If a move the mouse outside Firefox and click in another window, the browser URL field is updated and the rest of the document is updated. I then tried the code in google-chrome. There everything works fine. If I add a console.log() in the hashchange eventhandler, everything works fine. Another work-around is to use window.setTimeout and delay modification of document.title by e.g. 10ms. Is this a problem in Firefox, or am I not supposed to modify document.title on the hashchange event? I am using Firefox 88.01 for Fedora 33. I guess I should not include HTML and JavaScript in this editor?

Alle antwurden (1)

more options

Hi

This does not sound like a Firefox issue, more of a web development question. I recommend that you ask the experts in this at: https://stackoverflow.com/.