I tried to make some script that handle with event like "panel changes follow by URLhash". I had no problem with event on button or link but I had problem when I refreshed the page. My panel couldn't keep its values and automatically reset.
And I tried to solve refresh problem like this:
<script>
document.addEventListener('keydown', function(e) {
if(e.which == 116) {
window.alert("1234");
var id = window.location.hash;
changePanel(id);
}
}, false);
</script>
As code I shown you, alert()
function it was working, but changePanel()
wasn't working. I think because alert()
had ran before refreshed and changePanel()
also. But in case of changePanel()
it ran before refresh then after refreshed all changes are reset to default.
How to run changePanel()
after refresh?