Open a new page when clicking a link in the same window
I want to open a page when a link is clicked in the same window. but the situation is that where the link was is the Popup Extender model. After the first click on the link, I close the model popup and open the page. I am trying two methods.
<script language="javascript" type="text/javascript">
function showMessage(err) {
parent.document.getElementById("div1").style.visibility = "hidden";
window.location.href = err; //does't give any result.
window.open (err,'_self',true);//open page in new tab
}
</script>
+3
source to share
3 answers
I try this code and it worked successfully.
I first sent the control from the child page to the parent page using this code.
<script language="javascript" type="text/javascript">
function openpage(pageurl) {
parent.openNewPage(pageurl);//call a function of parent page
}
</script>
<script language="javascript" type="text/javascript">
function openNewPage(pageurl)
{
window.open(pageurl,"_self","");
}
</script>
It first closed the model popup and then opened a new page on the parent page.
Thanks a lot for your cooperation.
0
source to share