Get user location with javascript || Two methods (with/without permission)

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 พ.ย. 2024

ความคิดเห็น • 31

  • @tazimtazvi3645
    @tazimtazvi3645 ปีที่แล้ว +1

    how can i take that latitude and longitude in a input field/form data to store in the data base? can you help?

  • @AbhishekSharma-fg1ho
    @AbhishekSharma-fg1ho ปีที่แล้ว +1

    in my case its not asking location and i am facing error which is can not access location and site is also not secure what i do

  • @arjumandtalat
    @arjumandtalat 4 หลายเดือนก่อน

    I tried this on my pc and it showed the details there but when i used my phone to access the website and click the button and then i checked in the console of my pc, it didnt show anything and i couldnt see the user’s (my phone’s) lat long and stuff i can only see when i use my pc

  • @alanm.c.4218
    @alanm.c.4218 8 หลายเดือนก่อน

    this method also work connecting to that application via phone? i mean it will ask you in your phone to allow your location?

  • @krishnadhoot4141
    @krishnadhoot4141 ปีที่แล้ว +2

    can u provide the source code?

  • @dahomtech1372
    @dahomtech1372 ปีที่แล้ว

    Sir plz whay when open my website in android can't take theocation but when open my website by pc take location success

  • @somnathruidas648
    @somnathruidas648 3 หลายเดือนก่อน

    Name of the extension.

  • @YoungestInCharge524
    @YoungestInCharge524 ปีที่แล้ว +4

    bro blurred his lat and long😂😂 are you wanted?

    • @Koded
      @Koded  ปีที่แล้ว +1

      Yeah. Don't call FBI

  • @yashparab1304
    @yashparab1304 ปีที่แล้ว +1

    If a user already or previously agrees to share his location or means we have its permission now we directly access its location,when the website is getting loaded , how can we implement that in javascript?

    • @Koded
      @Koded  ปีที่แล้ว

      yep, that works with the code in the video. If the user agrees, it is saved in the browser and the if condition in our code checks for the same

    • @dahomtech1372
      @dahomtech1372 ปีที่แล้ว

      @@Koded Sir plz whay when open my website in android can't take theocation but when open my website by pc take location success

  • @karismapribadi
    @karismapribadi ปีที่แล้ว

    Hi bro, I want just to run script.js only, not with IP, but after I upload it on hosting, permission always denied, I tried in different device but the error result still same, do you have suggestion?

    • @karismapribadi
      @karismapribadi ปีที่แล้ว

      It's worked if I run it via localhost, error while I tried this code online

  • @c.l5378
    @c.l5378 ปีที่แล้ว +1

    Is this work in Mobile phone

    • @Koded
      @Koded  ปีที่แล้ว

      of course, it will

  • @killerpop1017
    @killerpop1017 ปีที่แล้ว

    what app are you using?

    • @Koded
      @Koded  ปีที่แล้ว

      I am using Firefox and VS code.

  • @gameboyv1790
    @gameboyv1790 ปีที่แล้ว

    can you make it so you still get the location if they decline

    • @Koded
      @Koded  ปีที่แล้ว

      You can use ip address to get the location

    • @gameboyv1790
      @gameboyv1790 ปีที่แล้ว

      @@Koded pls help me

    • @Koded
      @Koded  ปีที่แล้ว

      I have shown two different ways in the video. You can try another if one doesn't work 🙂

  • @amanshetty522
    @amanshetty522 ปีที่แล้ว

    where can i get the source code bro

    • @mixrapmusic8118
      @mixrapmusic8118 ปีที่แล้ว

      Here's an example of how to use the Geolocation API in HTML:
      ```html
      Geolocation Example
      function getLocation() {
      if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(showPosition);
      } else {
      alert("Geolocation is not supported by this browser.");
      }
      }
      function showPosition(position) {
      var latitude = position.coords.latitude;
      var longitude = position.coords.longitude;
      alert("Latitude: " + latitude + "
      Longitude: " + longitude);
      }
      Get Location
      ```

  • @yashvantsinhchavda3711
    @yashvantsinhchavda3711 2 ปีที่แล้ว +1

    👍

    • @Koded
      @Koded  2 ปีที่แล้ว

      👍