I used pop up in my site.The problem is, when i open a pop up and go to the other page and then go back to previous page, a pop up will refresh and open again!! without any pressed!
How can i fix it?
I want that this pop up wont come up again by coming back to that page.
here is my Pop up code:
.......
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.min.js" ></script>
<script type='text/javascript' src='jquery-1.2.3.min.js'></script>
<script type='text/javascript' src='menu.js'></script>
<script type="text/javascript">
function pop_up(url) {
newwindow = window.open(url, 'name', 'height=517,width=885,scrollbars=yes,toolbar=no,menubar=no,resizable=yes,location=no,directories=no,status=no,titlebar=no,left=400,top=120');
if (window.focus) { newwindow.focus() }
return false;
}
</script>
<link href="style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.style2
{
.......
and behind code:
Page.ClientScript.RegisterStartupScript(GetType(), "popup", "pop_up('" + "PopUpEmailing.aspx" + "');", true);
One solution would be to use the
window.nameproperty.I know this solution can lead to conflicts if another library also tries to use this.
But I prefer this more then using a cookie. (You could also think over using local storage)