jQuery Reload Current Page on Click – WortGepresst



STARTSEITE MULTIMEDIA WORTGEPRESST FAMILIENBANDE BOOKMARK PRIVACY


jQuery Reload Current Page on Click

Let’s say you have an HTML link such as:

 
Adding the following jQuery script will reload the current page when clicked:

JavaScript

 

Keep in mind that if you know the URL of the page that will contain the link, there is no need for JavaScript, as you can simply write:

 
..where/current-page/is the relative URI of the current page. Thus, the jQuery reload technique is useful in scenarios where the page URL is not known at page load. For example, when redirecting to auser-submitted post.

Font Resize
Contrast
Zur Werkzeugleiste springen