| ★ wanayoo — archive 1999 http://webtools.com/story/dhtml/TLS19980813S0001 | Nouvelle recherche | Portail wanayoo |
![]() |
![]() |
Free E-mail
|
![]() |
|
||||||||||||||
![]() |
||||||||||||||
|
Automate daily changes to your Web pages with some JavaScript sleight of hand. By David W. Methvin, Windows Magazine (06/01/98) As a Web surfer, I know it's not very compelling to visit a page that doesn't change for months at a time. On the flip side, as a Web-page builder, I dread the work involved in editing and reposting pages. So I decided to build a simple tool anyone can use to change the content of a Web page based on the time or date. For example, you might build a page once every week but incorporate changes that would automatically take effect every day -- and you wouldn't have to re-edit the page on a daily basis. Products such as Microsoft's FrontPage have features to make timed content rotation easier, but not everyone has access to those tools. If you're using an ISP or Web farm to host your site, it might not even allow you to run any kind of server-side code such as active server pages. So that leaves browser-side scripting -- JavaScript in this case -- as the only choice. Even if you can use FrontPage or some other server-side solution, you might prefer a browser-side script for its simplicity. There is one important downside to this approach, though. Since the script is run on the browser, anyone who views your Web page's HTML source will be able to see the entire schedule of events you have planned. Most people won't look at the source, but don't be surprised if someone does grab a sneak peek. If it's just a list of holidays or a message of the day, there's no problem. But don't use this script to schedule anything in advance that would get you in trouble if it were disclosed early. Two less common problems are users with browsers that don't support JavaScript and users who have disabled JavaScript support in their browser's security settings. That is, they're either three years behind the browser adoption curve, or they're extremely paranoid about security. I can't do much to help either group live a richer browsing life, but I do try to make their visit comfortable by degrading the page design gracefully with a <SCRIPT LANGUAGE=NONE> tag and some alternate text.
[Rotation Automation>>>]
Page 1 of 3 |
|
|||||||||||||
| ||||||||||||||
| |||||
![]() |
|