Hey everyone. I am attempting to have an ajax script pop up a window when the database detects a flag and a user can click one of the links in that pop up. I have been able to get the ajax to pop up the window and i have been able to get the page to load and the pop up close when a link is clicked, but the page that loads is loaded into the page where the ajax created the pop up.
I need to open a new window or tab when a user clicks on a link in the pop up and the pop up close. The new page should not load in the page that generated the pop up.
Here is the code that I am testing with in the pop up window :
[code=php]<script language=”Javascript”>
function toMainWindow(URL){
mainWindow=window.opener;
if (mainWindow == null || mainWindow.closed){
mainWindow = self;
mainWindow.location=URL;
return false;
}
else {
if (mainWindow.exitvariable != null)
{
mainWindow.exitvariable=false;
}
mainWindow.location=URL;
self.close();
}
}
</script>
<script language=”javascript”>
window.location=”conference.php?id=1″;
toMainWindow(“conference.php?id=1”);
self.close();
</script>