20.11.2017 Views

My HTML 5

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>HTML</strong>5<br />

function errorHandler(err) {<br />

if(err.code == 1) {<br />

alert("Error: Access is denied!");<br />

}<br />

}<br />

else if( err.code == 2) {<br />

}<br />

alert("Error: Position is unavailable!");<br />

function getLocation(){<br />

if(navigator.geolocation){<br />

// timeout at 60000 milliseconds (60 seconds)<br />

var options = {timeout:60000};<br />

navigator.geolocation.getCurrentPosition(showLocation,<br />

errorHandler, options);<br />

}<br />

}<br />

else{<br />

}<br />

alert("Sorry, browser does not support geolocation!");<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

126

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!