crop_rotate
Run
<html> <head> </head> <body> <h1>JavaScript Window History State Value</h1> <p id="data">State Value :</p> <input type="button" value="Get Value" id="myVal"> <script> let myVal = document.getElementById("myVal"); let data = document.getElementById('data'); const state = { 'pageID': 1, 'userID': 5 ,'pageTitle':'CloseTag'} history.pushState(state,'') myVal.addEventListener('click',()=>{ data.innerText += history.state.pageTitle }) </script> </body> </html>
PGh0bWw+DQo8aGVhZD4NCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+IDo6LXdlYmtpdC1zY3JvbGxiYXJ7d2lkdGg6N3B4O2hlaWdodDo3cHg7fTo6LXdlYmtpdC1zY3JvbGxiYXItdHJhY2t7YmFja2dyb3VuZDojZmZmO306Oi13ZWJraXQtc2Nyb2xsYmFyLXRodW1ie2JvcmRlci1yYWRpdXM6NXB4O2JhY2tncm91bmQ6IzJmNDVmZjt9PC9zdHlsZT48L2hlYWQ+DQo8Ym9keT4NCjxoMT5KYXZhU2NyaXB0IFdpbmRvdyBIaXN0b3J5IFN0YXRlIFZhbHVlPC9oMT4NCjxwIGlkPSJkYXRhIj5TdGF0ZSBWYWx1ZSA6PC9wPg0KPGlucHV0IHR5cGU9ImJ1dHRvbiIgdmFsdWU9IkdldCBWYWx1ZSIgaWQ9Im15VmFsIj4NCg0KPHNjcmlwdD4NCmxldCBteVZhbCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJteVZhbCIpOw0KbGV0IGRhdGEgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnZGF0YScpOw0KY29uc3Qgc3RhdGUgPSB7ICdwYWdlSUQnOiAxLCAndXNlcklEJzogNSAsJ3BhZ2VUaXRsZSc6J0Nsb3NlVGFnJ30NCmhpc3RvcnkucHVzaFN0YXRlKHN0YXRlLCcnKQ0KbXlWYWwuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLCgpPT57DQogIGRhdGEuaW5uZXJUZXh0ICs9IGhpc3Rvcnkuc3RhdGUucGFnZVRpdGxlDQp9KQ0KPC9zY3JpcHQ+DQo8L2JvZHk+DQo8L2h0bWw+