Javascript : How to refresh page with JQuery ?
Sometimes, easy thing such as refreshing a page with javascript or jquery is the hardest thing to remember. To refresh a page with JQuery, use this code fragment below :
$('#yourbuttonid').click(function() {
location.reload();
});
Options that you might to know about
location.reload(false) - Default setting and will reload the current page from the cache.
location.reload(true) - Force a reload from the server.
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+4.5k How to check with curl if my website or the asset is gzipped ?
+10.9k Golang : List running EC2 instances and descriptions
+8.4k Golang : How to protect your source code from client, hosting company or hacker?
+9.2k JavaScript/JQuery : Detect or intercept enter key pressed example
+18.8k Golang : Count number of digits from given integer value
+4.2k Gogland : Datasource explorer
+10k Golang : Find age or leap age from date of birth example
+17.7k Golang : Fix cannot download, $GOPATH not set error
+18.4k Golang : How to count the number of repeated characters in a string?
+12.6k Golang : Fix cannot use buffer (type bytes.Buffer) as type io.Writer(Write method has pointer receiver) error
+6.2k Golang : Rot13 and Rot5 algorithms example