久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <bdo id='Ui8rk'></bdo><ul id='Ui8rk'></ul>

      <small id='Ui8rk'></small><noframes id='Ui8rk'>

      <i id='Ui8rk'><tr id='Ui8rk'><dt id='Ui8rk'><q id='Ui8rk'><span id='Ui8rk'><b id='Ui8rk'><form id='Ui8rk'><ins id='Ui8rk'></ins><ul id='Ui8rk'></ul><sub id='Ui8rk'></sub></form><legend id='Ui8rk'></legend><bdo id='Ui8rk'><pre id='Ui8rk'><center id='Ui8rk'></center></pre></bdo></b><th id='Ui8rk'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Ui8rk'><tfoot id='Ui8rk'></tfoot><dl id='Ui8rk'><fieldset id='Ui8rk'></fieldset></dl></div>
    1. <tfoot id='Ui8rk'></tfoot>

      <legend id='Ui8rk'><style id='Ui8rk'><dir id='Ui8rk'><q id='Ui8rk'></q></dir></style></legend>

      每次用戶重新加載頁面時,讓 html5 地理定位請求

      Make html5 geolocation ask permission every time user reloads the page(每次用戶重新加載頁面時,讓 html5 地理定位請求權限)
      <tfoot id='1akKN'></tfoot>
          <tbody id='1akKN'></tbody>

          • <bdo id='1akKN'></bdo><ul id='1akKN'></ul>
            <i id='1akKN'><tr id='1akKN'><dt id='1akKN'><q id='1akKN'><span id='1akKN'><b id='1akKN'><form id='1akKN'><ins id='1akKN'></ins><ul id='1akKN'></ul><sub id='1akKN'></sub></form><legend id='1akKN'></legend><bdo id='1akKN'><pre id='1akKN'><center id='1akKN'></center></pre></bdo></b><th id='1akKN'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='1akKN'><tfoot id='1akKN'></tfoot><dl id='1akKN'><fieldset id='1akKN'></fieldset></dl></div>

              <small id='1akKN'></small><noframes id='1akKN'>

              <legend id='1akKN'><style id='1akKN'><dir id='1akKN'><q id='1akKN'></q></dir></style></legend>
              1. 本文介紹了每次用戶重新加載頁面時,讓 html5 地理定位請求權限的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我們為什么需要它:

                我們的網站中有一些頁面允許用戶輸入一些數據并搜索他們所在地區的其他客戶.當用戶打開該頁面時,必須顯示彈出消息

                We have some page in our website which allows users to enter some data and search for another customers in their area. When user opened that page the popup message must be shown

                http://foo.bar.com想使用您當前的位置.

                之后,用戶可以放棄它并手動填寫位置字段或接受并自動重定向到結果頁面.

                After that user can discard that and fill the location fields manually or accept and be automatically redirected to results page.

                問題:

                問題是當用戶第一次選擇任何提到的選項時,瀏覽器會記住它并且下次不會再詢問它.因此,當用戶接受它時,每次他打開搜索頁面時,它都會自動將他重定向到結果頁面,而無需詢問任何內容.

                The problem is that when user selects any of the mentioned options at first time, browser remembers it and don't ask it next time. So when user accept it, every time he open the search page it will automatically redirect him to results page withous asking anything.

                代碼:

                我們使用的是基本的 html5 地理位置代碼

                We are using basic html5 geolocation code

                if (navigator.geolocation) {
                   navigator.geolocation.getCurrentPosition(LocationMethod);
                } 
                

                結論:

                我很確定不可能更改瀏覽器原生的權限.但我希望有人會為這個問題提供很好的解決方案.謝謝.

                I'm pretty sure that it's impossible to change permission that are browser-native. But I hope that someone will give nice solution for this problem. Thanks.

                推薦答案

                一旦用戶點擊拒絕/允許,瀏覽器就會為網站記住這個決定.

                once a user clicks deny/allow the browser remembers this decision for the site.

                避免拒絕的最佳方法是僅在用戶單擊表示他想使用其位置的內容時調用 getCurrentPosition(...).然后他可能會很樂意分享它:)

                the best way to avoid a deny is to only call getCurrentPosition(...) when the user clicked something that means he wants to use his location. and then he would probably be glad to share it :)

                foursquare 網站就是一個很好的例子.進入后,您可以前往某個城市的地圖,并且只有通過單擊地圖上的使用我的位置"按鈕,它才會提示您.

                A good example is on foursquare site. on entering it offers you to go to the map to some city, and only there by clicking the button on the map of "use my location" it prompts for it.

                如果您被拒絕該位置,您還可以顯示一條信息消息您過去曾拒絕此站點的位置服務,請啟用它做 bla bla bla".隨便填bla bla bla.

                If you are denied the location you could also show an info message with "you have denied location service in the past for this site, do enable it do bla bla bla". and fill in the bla bla bla with whatever.

                這篇關于每次用戶重新加載頁面時,讓 html5 地理定位請求權限的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Use IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)
                anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 項目中不起作用)
                Ionic 3 - Update Observable with Asynchronous Data(Ionic 3 - 使用異步數據更新 Observable)
                Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
                In Ionic 2, how do I create a custom directive that uses Ionic components?(在 Ionic 2 中,如何創建使用 Ionic 組件的自定義指令?)
                Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(將 ViewChild 用于動態元素 - Angular 2 amp;離子2)
              2. <tfoot id='g5XbP'></tfoot>
              3. <i id='g5XbP'><tr id='g5XbP'><dt id='g5XbP'><q id='g5XbP'><span id='g5XbP'><b id='g5XbP'><form id='g5XbP'><ins id='g5XbP'></ins><ul id='g5XbP'></ul><sub id='g5XbP'></sub></form><legend id='g5XbP'></legend><bdo id='g5XbP'><pre id='g5XbP'><center id='g5XbP'></center></pre></bdo></b><th id='g5XbP'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='g5XbP'><tfoot id='g5XbP'></tfoot><dl id='g5XbP'><fieldset id='g5XbP'></fieldset></dl></div>

                  <tbody id='g5XbP'></tbody>

                  <bdo id='g5XbP'></bdo><ul id='g5XbP'></ul>
                  <legend id='g5XbP'><style id='g5XbP'><dir id='g5XbP'><q id='g5XbP'></q></dir></style></legend>

                    <small id='g5XbP'></small><noframes id='g5XbP'>

                        • 主站蜘蛛池模板: 亚洲国产精 | 国产免费久久 | 亚洲国产精品久久久久久 | 久久少妇| 欧美黑人性猛交 | 免费精品视频 | 可以免费看黄的网站 | 美日韩在线 | 日韩黄色大片 | 欧美激情精品 | 国产精品久久免费 | 日本成人一区 | 中文字幕一二三四区 | 中文字幕黄色片 | 日本激情网站 | 中文字幕在线观看日本 | 免费一区二区三区 | 午夜精品一区二区三区在线视频 | 精品一区二区三区免费看 | 久久精品美女 | 国产不卡在线观看 | 日韩 国产 欧美 | 高潮一区二区三区乱码 | 久久99精品久久久久久琪琪 | 男人操女人视频网站 | 日韩一区二区在线视频 | 国产精品自拍小视频 | 日韩色综合 | 国产午夜影院 | 国产精品一区二区三区不卡 | 久草福利资源 | 丁香五香天堂网 | 黄色xxxxx | 91在线看片 | 国产91免费| 丰满少妇高潮 | 日韩毛片 | 国产农村妇女aaaaa视频 | 国产成人在线观看免费网站 | 91麻豆精品一区二区三区 | 欧美成人精品一区二区 |