aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes client side storage for firefox, chrome & IE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "client side storage for firefox, chrome & IE" Watch "client side storage for firefox, chrome & IE" New topic
Author

client side storage for firefox, chrome & IE

albert kao
Ranch Hand

Joined: Feb 04, 2010
Posts: 245
How to store some strings at the client side for firefox, chrome & IE?
This code works on firefox & chrome but does not work on IE - no alert window appears.


This code does not work on firefox, chrome nor IE - no alert window appears.

I use the Prototype JavaScript Framework on Windows Vista Home.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Are you using IE8?

Eric
albert kao
Ranch Hand

Joined: Feb 04, 2010
Posts: 245
Eric Pascarello wrote:Are you using IE8?

Eric


Yes.
I plan to support IE7 too.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

albert kao wrote:I plan to support IE7 too.


Not if you want local storage capabilities.


GenRocket - Experts at Building Test Data
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Gregg Bolinger wrote:
albert kao wrote:I plan to support IE7 too.


Not if you want local storage capabilities.


AKA, IE7 does not support it. You would have to have the user install a 3rd party plug-in to do it.

Eric
albert kao
Ranch Hand

Joined: Feb 04, 2010
Posts: 245
Eric Pascarello wrote:
Gregg Bolinger wrote:
albert kao wrote:I plan to support IE7 too.


Not if you want local storage capabilities.


AKA, IE7 does not support it. You would have to have the user install a 3rd party plug-in to do it.

Eric


Which 3rd party plug-in should I use?
Does the Prototype JavaScript Framework support local storage capabilities?
Does IE8 support local storage capabilities?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
albert kao wrote:
Which 3rd party plug-in should I use?

http://gears.google.com/ is an option, but it is not being updated anymore

albert kao wrote:
Does the Prototype JavaScript Framework support local storage capabilities?

http://www.domcached.com/ is one option, I am sure you can find others if you searched. EW to prototype.js

albert kao wrote:
Does IE8 support local storage capabilities?

http://lmgtfy.com/?q=localStorage+IE&l=1

Eric
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Just as a tip, you're relying on some cutting edge, technically not official features of an unfinished HTML specification (HTML 5). If you have that luxury then good on ya, but I foresee much pain in your future.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61198
    
  66

Do you really think that your users will appreciate having to install a plugin to use your site?

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
albert kao
Ranch Hand

Joined: Feb 04, 2010
Posts: 245
Gregg Bolinger wrote:Just as a tip, you're relying on some cutting edge, technically not official features of an unfinished HTML specification (HTML 5). If you have that luxury then good on ya, but I foresee much pain in your future.


In that case, what are my options to store some user preferences?
Is cookie a good idea?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Reason you do not store user preferences on the server?

Cookies may not be enabled, they can only hold so much information, they get sent to the server with every request.

Eric
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

The purpose in HTML5's local storage feature is to allow your users to use the application offline. Google created gears because they wanted people to still be able to access their email, documents, calendars, etc even if they didn't have a connection to the internet. It was not meant to store user preferences (unless you need them for offline viewing).

As Eric said, store it on the server. In fact, no matter what you do with local storage, everything should still be on the server. That's the point. Use local storage when you need it, but always have it on the server.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61198
    
  66

I foresee this as the next shiny new toy that will be used badly and needlessly just because it's "cool".
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Bear Bibeault wrote:I foresee this as the next shiny new toy that will be used badly and needlessly just because it's "cool".


My problem with local storage (not specifically HTML5) is that any Tom, Dick, and Harry can write a web application that stores who the hell knows what on my local computer. Cookies are one thing, controlled. But who's stopping Dick (pun intended) from loading his data warehouse on my local machine? You know, just because he can.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: client side storage for firefox, chrome & IE