I have added code to change web page color on beforeunload
event:
window.onbeforeunload = function (){
$('.navbar-collapse').css({background: 'blue'});
console.log("Hello unload");
return null;
}
- This code works properly on Chrome and Firefox but it doesn't work on Safari browser.
- However, when I debug this code in Safari, when stepping over each line of code in the callback function, id DOES changes background color.
- When I navigate by clicking on an url on page and then click back button on browser, the background color is changed.
Any idea?