My website uses the iframe to load content inside div element. My problem is when a page is refresh it redirect to the main page not to the current page.
Here is the part of the code.
<a href="promotion.jsp">Promotion</a>
And here is the javascript function I used.
$(document).ready(function(){
var url;
$('a').click(function(e){
e.preventDefault();
url = $(this).attr('href');
if(undefined != url){
window.frames["page-wrapper"].src = url;
clickFront();
}
});
$("button").click(function() {
checkUrlandId(url,this.id);
});
});
clickFront()
is function that enable and disable some top menu bar button functionalities.
So when I click menu item(Approvals) page changed. After that page refreshes it redirect to the main page not to the current page.
Here are two screenshots. First one is before clicking the menu item and second one is after clicking the menu item.
After clicking the menu item url is not changing.
I read that we can use cookies or javascript localstorage to save the url to do this? Can someone help me... I'm a newbie to the js.