Access iPhone GPS with Javascript

navigator.geolocation.getCurrentPosition(success, fail);
 
// success callback, gets passed position object
success(position) {
	alert(
		"Your latitude: " + position.coords.latitude +
		"longitude: " + position.coords.longitude);
}

Download this snippet

Javascript code for accessing the iPhone 3.0 GPS in Safari.

Twitter Twitter

2 Comments to “ Access iPhone GPS with Javascript”

  1. Anonymous  on Sep 04, 2009

    kMBufM <a href="http://nccqyqppvsfn.com/">nccqyqppvsfn</a>, [url=http://zoprhnsppvfl.com/]zoprhnsppvfl[/url], [link=http://ziinbaqwnjfa.com/]ziinbaqwnjfa[/link], http://insnrjnxsaan.com/

  2. Anonymous  on Mar 14, 2010

    r9CErv <a href="http://uctuqmytgmix.com/">uctuqmytgmix</a>, [url=http://jxzbpavaijrb.com/]jxzbpavaijrb[/url], [link=http://toafkhbgfezg.com/]toafkhbgfezg[/link], http://kcurtzminmur.com/

Leave a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>