@JonaAug 02.2004 — #[font=trebuchet ms]I'm having difficulty understanding your problem. You want a window to popup, each time the document is modified?[/font]
@bmdauthorAug 02.2004 — #[i]Originally posted by Jona [/i]
[B][font=trebuchet ms]I'm having difficulty understanding your problem. You want a window to popup, each time the document is modified?[/font] [/B][/QUOTE]
Basically yes,
The pop-up page will be a news flash page that the client only wants to pop-up whenever the file has been changed to reflect new news.
@JonaAug 02.2004 — #[font=trebuchet ms]Is this what you're after? [url=http://66.170.214.217/jona/research/javascript/bdm/modified.html]Example[/url].[/font]
<i> </i><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/xhtml1-strict.dtd"> <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Document modification notification example</title> <script type="text/javascript"> function getCVal(cName){ if(document.cookie.indexOf(cName) == 1){ return 0; } else { var cData = document.cookie.split("=")[1]; cData = cData.split(";")[0]; return cData; } } window.onload = function(){ var d = new Date(); var cD = d.toGMTString(); var nD = document.lastModified; if (getCVal("lVisit") > nD) { window.open("updates.html","child","width=400,height=400"); } document.cookie="lVisit="+cD+"; expires=Monday, 04-Apr-2006 05:00:00 GMT"; } </script> </head> <body> <h1>JavaScript Cookie Exapmle</h1> <p>You must have JavaScript and cookies enabled to view this example.</p> </body> </html>
I can't access your example but what I'm after is a pop-up that fires from the home page the first time you visit the site. The pop-up only then appears once the .htm file in the pop-up has been updated.
@JonaAug 03.2004 — #[font=trebuchet ms]Sorry that's on a personal server and only works when I'm online.
What I gave, though, is not exactly what you are now asking, so it's not important. If I understand correctly, you want a popup to appear if there is no cookie, and once the popup appears, a cookie is set to the last modified date of the file. Next time they visit the site, if the cookie exists and is not equal to the last modified date of the popup, show the popup, otherwise don't show it. Correct? The only way you could do this, would be to open the popup, and close it automatically if the cookie date and last modified date are equal, because you cannot get the last modified date of the popup from the parent window.[/font]