How to force a page to reload if all what was changed in url is hash?
Remove the anchor you’re going to navigate to, then use approach #2? Since there’s no anchor, setting the hash shouldn’t scroll the page.
Remove the anchor you’re going to navigate to, then use approach #2? Since there’s no anchor, setting the hash shouldn’t scroll the page.
$(‘body’).bind(‘beforeunload’,function(){ //do something }); But this wont save any info for later, unless you were planning on saving that in a cookie somewhere (or local storage) and the unload event does not always fire in all browsers. Example: http://jsfiddle.net/maniator/qpK7Y/ Code: $(window).bind(‘beforeunload’,function(){ //save info somewhere return ‘are you sure you want to leave?’; });
This should technically be achievable using window.location.reload(): HTML: <button (click)=”refresh()”>Refresh</button> TS: refresh(): void { window.location.reload(); } Update: Here is a basic StackBlitz example showing the refresh in action. Notice the URL on “/hello” path is retained when window.location.reload() is executed.
Even though it would be handy if %reset would clear the namespace and the cache for the imports (as in the notebook) one can explicitly reload a previously imported module using importlib.reload in python3.4 or imp.reload in python3.0-3.3 (and if needed reset the kernel in a second step).
OK, apparently no-cache was not enough. The following does the trick: <meta http-equiv=”cache-control” content=”no-cache, must-revalidate, post-check=0, pre-check=0″ /> <meta http-equiv=”cache-control” content=”max-age=0″ /> <meta http-equiv=”expires” content=”0″ /> <meta http-equiv=”expires” content=”Tue, 01 Jan 1980 1:00:00 GMT” /> <meta http-equiv=”pragma” content=”no-cache” />
You don’t need jQuery to do this. Embrace the power of JavaScript. window.location.reload()
This works for me $(‘ul.questions li a’).click(function(event) { event.preventDefault(); $(‘.tab’).hide(); window.location.hash = this.hash; $($(this).attr(‘href’)).fadeIn(‘slow’); }); Check here http://jsbin.com/edicu for a demo with almost identical code
You could call an mWebView.reload(); That’s what it does
As of today, the proper way of doing this is: import sys, importlib importlib.reload(sys.modules[‘foo’]) from foo import bar Tested on python 2.7, 3.5, 3.6.
Just figured out the basic reason for this – Developer Tools Console must be open to access right-click options on the browser refresh button. There are two ways to do this. The quickest way is to press F12. You can also right-click anywhere on the page and select Inspect. I guess it is a feature … Read more