Latest Web News

Australian court rules against MP3 link site
Linking to copyright music posted elsewhere online without permission can be illegal, an Australian appeals court ruled Monday. The issue before a three-judge panel at the Federal Court of Australia was whether Stephen Cooper, a retired policeman who ran the now-defunct site MP3s4free.net, was legally allowed to post links...

ISP delays ADSL2+ services
Australian Internet service provider Netspace has delayed the launch of ADSL2+ services until February. Last September the ISP announced plans to sell services nationally based on the ADSL2+ standard, allowing speeds of up to 24Mbps, prior to the end of 2006. At the time Netspace told ZDNet Australia it would use a...

Stats show Aussie kids gaming less
Zelda, Mario and Sonic beware. Despite the bad press, Australia's latest generation of "fat kids" are playing more sport and fewer computer games. As Microsoft, Nintendo and Sony launch million-dollar marketing campagins for their latest game consoles, the bureau of statistics has reported a 10 per cent drop in the number of...

New Zealand Telecom, Yahoo Sign Web Deal
New Zealand Telecom announced Wednesday it has formed a joint venture with Yahoo Inc. and Australia's Seven Network to beef up content on its Internet portal Xtra. Telecom, New Zealand's biggest listed company, will have a 49 percent stake in the joint venture, with Yahoo and Seven holding the...

Google, YouTube not out to cannibalise TV
Google's new managing director of operations for South East Asia has outlined his vision for video on the Internet, saying he expects television will remain the preferred medium for watching full programs. Speaking to ABC TV's Inside Business, Richard Kimber said that after the company's recent acquisition of clip hosting...

Telstra tilts at broadband fund
As it launched a new campaign against regulation, Telstra yesterday submitted a last-minute $600 million proposal for the Government's Broadband Connect fund, ending 12 months of uncertainty about the company's participation in the project. Only on Friday Telstra's public policy chief, Phil Burgess, was quoted criticising Broadband Connect as "an unsound approach to building networks".

Broadband for rural areas
Southeast Queensland's mayors have unveiled a bold plan to connect rural townships with high-speed internet. The move involves the running of fibre optic cable alongside new water infrastructure pipelines. Proponents claim it could place regional Queensland on an equal commercial and educational footing with the city. Council of Mayors chairman Campbell Newman, the lord mayor of...


01.02.07


Data Saving In Case Of Browser Crashes

By Raymond Camden

So a few days ago I posted a question on the BlogCFC blog about whether I should add "crash protection" to the BlogCFC entry editor.

What did I mean by that? As much as I love Firefox, it isn't the most stable beast in the world. That wouldn't matter so much except that I tend to get a bit worried when writing a particularly long blog entry. In the past I've used Word to write long entries since I know Word will automatically save my text even if I forget to. While BlogCFC does support XML-RPC clients, none of them have really caught on with my writing style so I haven't been using them.

Over on cf-talk, Jacob Munson mentioned that Blogger (I think that's some other blogware product - anyone heard of it? ;) will automatically save a draft of your blog entry every few seconds. I decided to take a look at how hard this would be to add to BlogCFC. Turns out it wasn't hard at all. I figured other people may benefit from this as a possible feature they could add to their own products.

So first off - let me talk a bit about the technique. The idea is simple: Every N seconds store the contents of the blog entry to a JavaScript cookie. Add code on the server side to check for this cookie when first displaying the form. Also add code to clean up the cookies when an entry has been stored.

For BlogCFC I decided to be lazy and only store two things - the title and body of the blog entry. Here is the JavaScript code I ended up using:



Cost Effective Website and Network Monitoring
IPCheck Server Monitor - Free Download

The first thing I want to point out are these two lines:



Outside of that - everything else is vanilla JavaScript. JavaScript lets you add cookies by simply setting the document.cookie value. Also note that document.cookie isn't a simple string. If you run document.cookie = something multiple times, you end up with multiple cookies.

The format for a cookie string is name=value; expires=DATE; path=PATH. In my case I simply used a cookie that expires in 7 days and a path of /.

Lastly I have a window.setTimeout, both outside of the function and inside, that will run this code every 5 seconds. Any duration is fine really.

To restore the values, I used this set of code on the server side:



Basically I simply ensure that I'm not already posting and see if I have anything in the cookie. I clear out the cookies using this code:



As you can see, this is a pretty trivial implementation. Anyone else using something like this in their applications?

Comments

About the Author:
Raymond Camden, ray@camdenfamily.com
http://ray.camdenfamily.com

Raymond Camden is Vice President of Technology for roundpeg, Inc. A long time ColdFusion user, Raymond has worked on numerous ColdFusion books and is the creator of many of the most popular ColdFusion community web sites. He is an Adobe Community Expert, user group manager, and the proud father of three little bundles of joy.

About DevWebProAU
DevWebProAU is for professional developers ... those who build and manage applications and sophisticated websites. DevWebProAU delivers via news and expert advice New Strategies In Development.

DevWebProAU is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
LinuxProNews.com WirelessProNews.com
CProgrammingTrends.com NetworkNewz.com



-- DevWebProAU is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2007 iEntry, Inc.  All Rights Reserved  Privacy Policy  Legal  

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article


Delivering IT Solutions DevWebProAU News Archives About Us Feedback DevWebProAU Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact