I have a function where I view the page at the top when the page loads using document.ready() . However, in Chrome, this function only works when I am on the page and I update it.
If I access the page by entering a link in the address bar, the function does not start. If I access a page from a link from another page, it also does not start. The only way it works 100% of the time in Chrome is if I am on the page and refreshing it.
However, in Safari, the function is launched 100% every time, accessing the page from a link, entering it in the address bar upon rebooting.
This is my code:
jQuery(document).ready(function($) { if (location.hash) {
This also works in Safari, not putting it in document.ready() , but again not in Chrome.
Does anyone know what causes this, and if it can be fixed? I used to have this problem and it was very unpleasant.
javascript jquery
Noob17
source share