NETWORK WORLD NEWSLETTER: MARK GIBBS ON WEB APPLICATIONS 10/11/04 Today's focus: Controlling Web page refresh
Dear [EMAIL PROTECTED], In this issue: * Sample JavaScript code for giving the user control over Web �� page refresh * Links related to Web Applications * Featured reader resource _______________________________________________________________ This newsletter is sponsored by Veritas Meta Group Whitepaper Database Infrastructure Performance Challenges: Approaches to Better Manage Application Database and Storage Subsystem Performance Corporate relational databases now manage the majority of business-critical data within the enterprise. IT organizations face continuing challenges in managing increasingly complex, data-driven application environments. Read this white paper to discover several factors which will converge to challenge the IT organization's ability to manage its database software infrastructure. http://www.fattail.com/redir/redirect.asp?CID=84724 _______________________________________________________________ SECURITY CONCERNS STOPPING YOUR WLAN PLANS? Is it possible to deploy a secure wireless LAN with technology available today? That question preys on the minds of IT executives who are tempted to deploy enterprise WLANs, but are hesitant because of security concerns. Find out what we uncovered when we assembled 23 wireless products trying to get to the answer. Click here: http://www.fattail.com/redir/redirect.asp?CID=84762 _______________________________________________________________ Today's focus: Controlling Web page refresh By Mark Gibbs In this issue I have a piece of code for you. This JavaScript is useful when you have a page that needs regular refreshing but where you'd also like to offer the user the option of turning refresh on or off. I created this code to control the display of network performance data that an application I wrote saves periodically in an HTML file. The problem I faced was that I sometimes needed to stop the refreshing to think about the contents. You can try this online at: <http://www.gibbs.com/examples/refresh.html> Let me know if this is useful to you or if you have a better way of doing this. Here's the code: <!DOCTYPE html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>gibbs.com Toggleable Refresh Example</title> <script language="JavaScript"> // The following variable must be set to 1; if we start with 0 // clicking on the checkbox simply forces a single refresh var RefreshEnabled = 1; // This variable specifies the refresh interval in milliseconds var RefreshInterval = 5000; // The JavaScript setTimeout method defines the function to // be called each time the specified period elapses. window.setTimeout("DoRefresh()", RefreshInterval); function DoRefresh() { if (RefreshEnabled == 1) {window.location = window.location.pathname+window.location.search;} // Let's assume this page was generated by the URL: // // <http://www.somesite.com/demos/refresh.html?update> // // The property window.location.pathname will be "demos/refresh.html" // and the property location.search will be the URL tail (the data sent // if the page involves a GET request). Thus the location.search property // for the URL above would be ?update. By setting the property // window.location to the combined value of these two existing properties // we force the given page to be loaded from the default domain // ("www.somesite.com") using the default access method ("http:"). } function ToggleRefresh() { if (RefreshEnabled == 1) {RefreshEnabled = 0;} else { RefreshEnabled = 1; DoRefresh(); } } </script> </head> <body> <script> // START TEST CONTENT. // The following code simply gives this example something to display // remove everything from here to "END TEST CONTENT." unless you want to // include an updating display of local time. DTG = new Date(); var Hours; var Mins; var Secs; var Time; Hours = DTG.getHours(); Mins = DTG.getMinutes(); Secs = DTG.getSeconds(); if (Hours >= 12) { Time = " PM"; } else { Time = " AM"; } if (Hours > 12) { Hours = Hours - 12; } if (Hours == 0) { Hours = 12; } if (Mins < 10) { Mins = "0" + Mins; } if (Secs < 10) { Secs = "0" + Secs; } document.write("<b>Time:</b> " + Hours + ":" + Mins + ":" + Secs + " " + Time ); // END TEST CONTENT. </script> <!-- The following checkbox generates a call to the function that toggles the autorefresh state when it is clicked. --> <input checked type="checkbox" onclick="ToggleRefresh()"> Check to autorefresh. </body> </html> RELATED EDITORIAL LINKS BEA polishes Diamond platform Network World, 10/11/04 http://www.nwfusion.com/news/2004/101104bea.html _______________________________________________________________ To contact: Mark Gibbs Mark Gibbs is a consultant, author, journalist, and columnist and he writes the weekly Backspin and Gearhead columns in Network World. We'll spare you the rest of the bio but if you want to know more, go to <http://www.gibbs.com/mgbio>. Contact him at <mailto:[EMAIL PROTECTED]> _______________________________________________________________ This newsletter is sponsored by Veritas Meta Group Whitepaper Database Infrastructure Performance Challenges: Approaches to Better Manage Application Database and Storage Subsystem Performance Corporate relational databases now manage the majority of business-critical data within the enterprise. IT organizations face continuing challenges in managing increasingly complex, data-driven application environments. Read this white paper to discover several factors which will converge to challenge the IT organization's ability to manage its database software infrastructure. http://www.fattail.com/redir/redirect.asp?CID=84723 _______________________________________________________________ ARCHIVE LINKS Archive of the Web Applications newsletter: http://www.nwfusion.com/newsletters/web/index.html _______________________________________________________________ Stop playing guessing games with IT efficiency Benefit from a set of best practices that provide IT with a comprehensive checklist for optimizing in the face of change. Tune in today. http://www.fattail.com/redir/redirect.asp?CID=84858 _______________________________________________________________ FEATURED READER RESOURCE THE NEW DATA CENTER Today's top companies are accelerating toward Web-based computing. That means building the new data center -- where grids, virtualization, autonomic computing and other big changes shatter the traditional boundaries on applications and information, and bring the extended enterprise to life. Learn about The New Data Center on NW Fusion's Research Center at: <http://www.nwfusion.com/topics/datacenter.html> _______________________________________________________________ May We Send You a Free Print Subscription? You've got the technology snapshot of your choice delivered at your fingertips each day. Now, extend your knowledge by receiving 51 FREE issues to our print publication. Apply today at http://www.subscribenw.com/nl2 International subscribers click here: http://nww1.com/go/circ_promo.html _______________________________________________________________ SUBSCRIPTION SERVICES To subscribe or unsubscribe to any Network World e-mail newsletters, go to: <http://www.nwwsubscribe.com/Changes.aspx> To unsubscribe from promotional e-mail go to: <http://www.nwwsubscribe.com/Preferences.aspx> To change your e-mail address, go to: <http://www.nwwsubscribe.com/ChangeMail.aspx> Subscription questions? Contact Customer Service by replying to this message. This message was sent to: [EMAIL PROTECTED] Please use this address when modifying your subscription. _______________________________________________________________ Have editorial comments? Write Jeff Caruso, Newsletter Editor, at: <mailto:[EMAIL PROTECTED]> Inquiries to: NL Customer Service, Network World, Inc., 118 Turnpike Road, Southborough, MA 01772 For advertising information, write Kevin Normandeau, V.P. of Online Development, at: <mailto:[EMAIL PROTECTED]> Copyright Network World, Inc., 2004 ------------------------ This message was sent to: [EMAIL PROTECTED]
