Prevent jQuery .load() if hash is visited <p>I am loading pages within a content <code>div</code> with <code>.load()</code> function and using <code>window.onhashchange</code> event to detect if the user is navigated.</p> <pre><code>window.onhashchange = function() { hash(window.location.hash.replace('#', '')) } </code></pre> <p>and</p> <pre><code>function hash(s) { $('.panel-body').fadeOut(100).load(s+'.php').fadeIn(100) } </code></pre> <p>Some of the pages takes long to load everytime. I don't want them to be reloaded (bypass <code>.load()</code> function) if the state is already cached. Any workaround?</p>