By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,451 Members | 994 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,451 IT Pros & Developers. It's quick & easy.

IE9 geo location

Expert 100+
P: 431
HI guys,

Small problem with IE9. When I try to use geo-location notification window pops up at the bottom of IE9 asking user to allow website to be located (see attachment). User has number of options and all is good, however I need a way to detect when user simply clicks on close (x) in notification window because at the moment if user does that nothing happens and it looks bit silly.


Expand|Select|Wrap|Line Numbers
  1.         if(navigator.geolocation){
  2.             navigator.geolocation.getCurrentPosition(
  3.                function(position){
  4.                     alert(position.coords.longitude)                   
  5.                 },
  6.                 errorHandler
  7.             );            
  8.         }
  10. function errorHandler(error){             
  11.         switch (error.code) {
  12.         case error.PERMISSION_DENIED: alert("user did not share geolocation data");
  13.             break;
  15.         case error.POSITION_UNAVAILABLE: alert("could not detect current position");
  16.             break;
  18.         case error.TIMEOUT: alert("retrieving position timed out");
  19.             break;
  21.             default: alert("unknown error");
  22.         break;
  23.         }        
  24. }
Attached Images
File Type: jpg Capture.jpg (8.4 KB, 143 views)
Jul 2 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.