Tuesday, August 28, 2012

This is Day Seven. Happy week of Web Design II. On this day, I have tinkered around with HTML 5 and seen what it can do. Especially with GeoLocation. This is a brand new thing for HTML 5, and it's really cool. I'm thinking about putting it on my website. I have learned a lot about GeoLocation so far, and might even expand on it. It's really interesting, and fun. 
Also, I can officially say that I have made Cases! Which is probably the happiest I have ever been getting an error. 
It can automatically detect an error, here's an example of my code:
 function locateFail(geoPositionError) {
                switch (geoPositionError.code) {
                    case 0:
                        alert('An unknown error occurred, sorry');

I have a total of 4 cases, including how the browser doesn't support GeoLocation, you don't have your location set up, unknown, and timed out. It's really cool, and I have always wondered how websites detect errors when they are happening. I have been really loving this class, and this HTML5 book is really helping me out with everything. I'm glad this book was purchased! 

No comments:

Post a Comment