Forum Moderators: open
Now this is probably gross abuse of the standard way of doing things, but I'm writing a mini email program with HTML as the menu format. Basically it saves me the trouble of writing a UI because my program generates an HTML page with two tables "Viewed" and "Unviewed". Messages are listed in the "Unviewed" table and by default have a link. The link opens another window with the content of the message inside.
The issue is, how can I setup my program so that it knows a user has opened an "unviewed" message? (Once my program knows this it can rewrite the HTML to move it to the "viewed" table).
My current solution sort of works: I've written in the javascript to have my main 'menu' page refresh every 5 seconds. Plus there's a program running in the background that looks for new web browers opening, and checks what they open to. If it detects an open browser at the right page, it rewrites the HTML menu.
The problem with my method is that there's a bit of a delay.. if the user rapidly opens and closes a message my program might not 'catch' it. Furthermore, the page inevitably refreshes during the middle of an HTML write (there's a small fraction of time between when the page is overwritten) that results in a blank page appearing, then there's no reloads. It's all fixed once the user clicks reload, but I could see people getting confused.
Does anyone know a way to create an HTML page that "polls" another page to make sure it's fully intact before loading it? I'm thinking if this is possible I could load that page and have it "poll" the HTML menu to make sure it's ready.. otherwise it'd say something like "Loading..".
Any suggestions or advice (other than "Stop using HTML for this you psycho!") ;) would be appreciated! :)
Cheers,
Bruce