Tim Leefo
Tim Leefo

Reputation: 11

Reload page only once via location.reload(false);

I know this question has been asked already but none of provided solutions are working on the site I am working on.

The staging site is: http://thetruthmadesimple.com/client/adaire/

I know refreshing isn't good practice but the situation is that the page looks good in Chrome and Safari but when loaded on FF is doesn't display correctly until F5/refresh.

location.reload(false); does reload but it has the same problem as others have had of looping and continuously reloading the page.

I am a novice to JS and jquery so any suggestions and/or solutions would help.

Upvotes: 1

Views: 453

Answers (1)

fjc
fjc

Reputation: 5805

Simple approach: Reload page with "#2" attached to URL, then check if #2 is attached and do not reload again:

if(window.location.hash !== "#2") {
    window.location.href += "#2";
    window.location.reload(false);
}

But hey, get your FF rendering in place ;)

Upvotes: 1

Related Questions