Refresh, Back Dan Reload Dengan Javascript - Dewa Blogger

Halaman

    Social Items

Buy Now
 Refresh, Back dan Reload dengan JavaScript

Tombol Refresh

//Metode 1 window.location.reload(); //Metode 2 history.go(0); //Metode 3 window.location.href = window.location.href;

Contoh

<input type="button" value="Refresh Halaman" onClick="window.location.reload()" /> <input type="button" value="Refresh Halaman" onclick="history.go(0);" /> <input type="button" value="Refresh Halaman" onclick="window.location.href=window.location.href;" />

Back dan Forward

history.go(-1); //back history.go(1); //forward

Contoh

<a href="javascript:history.go(-1)">Kembali</a> <a href="javascript:history.go(1)">Maju</a>

Sumber https://www.dte.web.id/

Refresh, Back Dan Reload Dengan Javascript

 Refresh, Back dan Reload dengan JavaScript

Tombol Refresh

//Metode 1 window.location.reload(); //Metode 2 history.go(0); //Metode 3 window.location.href = window.location.href;

Contoh

<input type="button" value="Refresh Halaman" onClick="window.location.reload()" /> <input type="button" value="Refresh Halaman" onclick="history.go(0);" /> <input type="button" value="Refresh Halaman" onclick="window.location.href=window.location.href;" />

Back dan Forward

history.go(-1); //back history.go(1); //forward

Contoh

<a href="javascript:history.go(-1)">Kembali</a> <a href="javascript:history.go(1)">Maju</a>

Sumber https://www.dte.web.id/