I am working on a piece of software that as an alarm feature build in. When an alarm is raised, a popup window is opened and details are displayed.
Now if a new alarm is raised, the popup window is refreshed with the new details.
I don’t want that . I want to check if the popup window is open and only show an alert if the popup window is NOT open.
I have this code.
[code=php]
<script type=”text/javascript”>
function checkAlarm() {
ajax_do (‘<?php echo $page->path;?>ajax/check_alarm.php’);
setTimeout(checkAlarm, 10000);
}
function showAlarm(sa) {
URL = ‘<?php echo $page->path.$page->public;?>alarm’;
alarm = window.open(URL, ‘alarm’, ‘toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=700,height=600’);
}
</script>
In the function ajax_do I basically check if an alarm has to be raised. If so the ajax calls showAlarm which opens the popup window.
Any help?
thanks