lovingboth: (Default)
[personal profile] lovingboth
We have a spiffy new intranet at work, otherwise known as hosting a minimal webserver on my PC with a PHP-based message board for internal notices.

Because I just know that half the staff aren't going to refresh their browsers to see if there are any new messages, I wanted the page to refresh automatically every so often.

The obvious way to do this is with <meta http-equiv="refresh" content="1800;URL=mboard.php"> in the head of the page - every 30 minutes this will reload itself.

But what if they're editing a new post at the time? Being cheap and cheerful, this script has the new post form at the bottom of the page that's being refreshed.

With Firefox, this doesn't matter as it will happily refill all the fields. But - as ever - Internet Explorer isn't that nice and blanks the lot.

Two of us have Firefox, everyone else is... well, they don't. And they would complain if this ever happened to them.

So, with a little bit of browsing, it's now has

<head>
<!-- blah blah blah, title and stuff -->
<script language="JavaScript" type="text/javascript">
<!-- reload page every fifteen minutes (reset if start entering a new post)
refreshit = setInterval("window.location.reload( true );", 15*60*1000);
//-->
</script>
</head>


and, in the first box of the 'start new thread' form...

<b>Name:</b><br><input type=text name="name" size=30 maxlength=30 onFocus="clearInterval(refreshit);">

i.e. if the box is selected, stop the setInterval function.

Is there an even easier way? Have I missed something horrible? It looks to work - it assumes you've got a JavaScript 1.2 or better browser, but...

Is this possible?

Date: 2005-03-04 12:56 pm (UTC)
ext_5939: (cyber)
From: [identity profile] bondagewoodelf.livejournal.com
Put the message submission form and the message window in seperate frames?

I know frames are supposed to be evil for some people, but this would this be a legitimate use of it?

Re: Is this possible?

Date: 2005-03-04 02:28 pm (UTC)
From: [personal profile] tempaccount99
Yep; Squirrelmail uses frames for exactly that reason. It's the one case where I don't object to them. Although a GMail-like DHTML and IFrames solution would be even nicer.

Profile

lovingboth: (Default)
Ian

February 2026

S M T W T F S
1234567
891011121314
15161718192021
22232425262728

Most Popular Tags

Active Entries

Style Credit

Expand Cut Tags

No cut tags