HTML5 in the Web browser: Geolocation, JavaScript, and HTML5 extras

Geolocation, Web Workers, History manipulation, iFrame sandboxes, and other HTML5 specs laying the groundwork for a safer and smarter Web

By Peter Wayner, InfoWorld |  Development, HTML5 Add a new comment

One of the sly games that smart managers play is attaching their current project to a big, high-profile tar ball rolling down the hill, full of momentum. Now that HTML5 has become white hot after languishing for 10 years of relative disinterest, many ideas that began as cool enhancements for the Web are latching on to the bandwagon. They may be relatively independent projects, but because they involve JavaScript and HTML, they're now part of the HTML5 juggernaut.

[ See also: HTML 5: The tipping point is with developers, not browsers ]

Consider the new JavaScript functions that let your Web page determine latitude and longitude if the code is running on a device that knows where it is. These are small enhancements that would have happened whether or not HTML5 became a buzzword that managers everywhere now feel compelled to add to their deck of slides. Yet now they're often considered in the same checklist full of HTML5 features.

[ Also on InfoWorld: "HTML5 in the browser: Canvas, video, audio, and graphics" | "HTML5 in the browser: Local data storage | "HTML5 in the browser: HTML5 data communications" | "HTML5 in the browser: HTML5 forms" ]

As we put together this series of articles about HTML5, a number of little ideas and features ended up with no place to go. They didn't naturally fit with the other articles that focused on areas such as HTML5 forms, data communications, local data storage, or the games people play with the HTML5 Canvas, video, and graphics specs. Some of these tidbits are officially part of the HTML5 standard and some are just fellow travelers, but they're all appearing in your browser soon. We had no better place to put them, so they're here.

"HTML5" geolocation The HTML5 spec doesn't officially offer the JavaScript layer the ability to find the device's location on earth, but HTML5 and geolocation have been gathering momentum at the same time, so people tend to lump them together. The geolocation tags are technically in a separate API, if you're curious.

The features are pretty basic and originally intended for smartphones and PDAs, but they're also implemented in many desktop browsers, including Chrome 5.0 and later, Firefox 3.5 and later, and Internet Explorer 9. But just because the JavaScript object navigator.geolocation is offered doesn't mean the answer returned will be available or correct. The API thankfully allows for users to cloak their location, and many implementations ask the user for permission before revealing the geolocation object to the JavaScript code. The API returns an error of the type PERMISSION_DENIED to make it clear that the user didn't want to cooperate.

A nice feature includes a rough estimate of the accuracy along with the coordinates. There's a separate error range for the altitude because many GPS tools are less accurate in their estimates of the altitude than they are of the position on earth. The error estimates for the latitude and longitude, however, are the same, perhaps a mistake near the poles.


Originally published on InfoWorld |  Click here to read the original story.

ITworld LIVE

DevelopmentWhite Papers & Webcasts

Webcast On Demand

How to Distribute Apps to Your Mobile Workforce

When considering enterprise app deployment, you may find some unexpected challenges and a number of options that range from simple distribution to running your own enterprise market. How can you determine the best approach for your organization? MOTODEV for Enterprise can help you understand and evaluate current enterprise deployment technologies and learn best practices that support your choice.

Sponsor: Motorola Mobility

Webcast On Demand

Authentication, Certificates and VPNs

MOTODEV for Enterprise can help get you up to speed quickly on key topics such as how to enable secure access to a company intranet from outside the firewall. This webinar provides a clear explanation of terms and technologies and what they can do for your enterprise app development.

Sponsor: Motorola Mobility

Webcast On Demand

Improving Enterprise App Quality with MOTODEV App Validator

MOTODEV for Enterprise supports quality app development for businesses, government, and institutions with technical resources and tools such as the MOTODEV App Validator, a free static analysis testing tool.

Sponsor: Motorola Mobility

White Paper

HR Analytics: Driving Return on Human Capital Investments

In today's economy, it's critical for organizations to make employee retention and development a major business focus, to ensure that valuable employees are not lost as the economy improves. With advanced BI solutions, organizations can be supported by workforce analytics to drive return on human capital investment and to see the value the workforce delivers to organizational performance. This white paper demonstrates how the increased power of having metrics and analytic insight can align core HR business processes with organizational goals and strategies and help ensure organizations make the right business decisions today for tomorrow.

White Paper

Positioning the CIO as a Powerful Business Partner with IT Portfolio Governance

In this whitepaper, learn how you can become a visionary portfolio manager and transform IT into a streamlined revenue and profit center.

See more White Papers | Webcasts

Ask a question

Ask a Question