How to deep refresh window in jquery like you press f5 twice.currently i m using this.
<script>
window.onload = function() {
if(!window.location.hash) {
window.location = window.location + '#loaded';
window.location.reload();
}
}
</script>
Thanks ! and it should not take much time to refresh. my webpage is in php.
Ctrl+F5 basically used to refresh the client objects. Whenever we change anything into client scripts then we usually do ctrl+f5 to get the updates. Obviously, no developer want this. Well there is a fix for that.
Seperate your js code into external file and use it in your view.Then, you just need to set a version of JS file where you gonna place it (i.e. in your view)
Suppose, path.js is your external JS file and
?123123
is basically a temporary versioning of the js file. So, the compiler will always treat it as new file by changing the number.Hope this helps
I think the reload function can take an argument that forces full refresh. ie:
For reference: https://developer.mozilla.org/en-US/docs/Web/API/Location/reload