views:

197

answers:

1

I am experimenting with HTML5 local storage functionality, but was frustrated to learn that the browser won't allow local storage when the file is local. My guess is that the browser (Chrome in my case, FF too) wants to see a domain rather than a file location. Has anyone here discovered a workaround for developing locally? Perhaps setting up a local domain? That sounds like too much trouble. There should just be a developer option in the browser, grrrrrr.

+2  A: 

You'll find that most web developers will set up a local web server, as it's the only way to work locally with server-side scripts—anything written in PHP, ASP.NET, Python, etc. which includes pretty much all content management systems. It's actually not too difficult, either. On Linux, just install Apache using your package manager (sudo aptitude install apache2 on Ubuntu). On Mac OS, you already have one installed—just turn Web Sharing on in System Preferences > Sharing and then navigate to http://localhost/~YourUsernameHere/. On Windows, I'd recommend installing the Apache HTTP Server if you just want a web server, or XAMPP if you want MySQL, PHP and Perl (which are great for server-side development) installed as well with minimum fuss.

Samir Talwar
+1 for XAMPP (on Linux or Windows). It's a no-brainer to setup and work with.
Paolo
Thanks. XAMPP and WAMP are solutions I use daily. Would still appreciate a 'switch' in the browser's developer settings though. I sense a Chrome Extension in the makings.
jasongonzales