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

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

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

      1. <small id='jDBT6'></small><noframes id='jDBT6'>

      2. <tfoot id='jDBT6'></tfoot>

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

        如何檢測用戶對地理位置的負(fù)面反應(yīng)

        How to detect negative user response for geolocation(如何檢測用戶對地理位置的負(fù)面反應(yīng))

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

                  <bdo id='vEU7K'></bdo><ul id='vEU7K'></ul>
                • <small id='vEU7K'></small><noframes id='vEU7K'>

                • 本文介紹了如何檢測用戶對地理位置的負(fù)面反應(yīng)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  使用geolocation API的navigator.geolocation.getCurrentPosition()如何處理否定響應(yīng)?

                  When using geolocation API's navigator.geolocation.getCurrentPosition() how to deal with a negative response?

                  表示出現(xiàn)錯誤時調(diào)用第二個回調(diào)函數(shù).但是,當(dāng)用戶通過取消請求來選擇不透露他的位置時,該函數(shù)永遠(yuǎn)不會被觸發(fā).

                  It says that the second callback function is called when there is an error. However when user chooses not to reveal his location by cancelling the request that function is never fired.

                  似乎 getCurrentPosition() 無限期地等待答案.(至少在 Firefox 4 中)

                  It seems that getCurrentPosition() waits for an answer indefinitely. (at least in Firefox 4)

                  我如何知道用戶何時按下取消(或否等)

                  How can I know when user presses cancel (or no etc.)

                  有什么想法嗎?

                  推薦答案

                  見下方編輯
                  你是對的,當(dāng)用戶拒絕位置請求時,錯誤處理程序應(yīng)該觸發(fā).傳遞給錯誤處理程序的錯誤對象應(yīng)包含錯誤代碼和消息,讓您知道用戶拒絕了請求.但是,從位置請求對話框中選擇選項 Not Now 時,我在 FF4 中沒有看到這一點.

                  See edit below
                  You are correct, the error handler should fire when a user denies the location request. The error object passed into the error handler should contain an error code and message letting you know the user denied the request. However, I'm not seeing this in FF4 when selecting the option Not Now from the location request dialogue.

                  在 Chrome 中,API/回調(diào)完全按預(yù)期工作,但在 Chrome 中沒有第三個選項.

                  In Chrome, the API/callbacks work exactly as expected, but in Chrome there is no 3rd option.

                  編輯
                  啊,好吧,我在 FF4 中的這種行為中發(fā)現(xiàn)了一個小怪癖.在普通模式下(非隱私瀏覽),用戶將看到 3 個選項:

                  EDIT
                  Ahhh okay I found a little quirk in the behavior of this in FF4. In normal mode (not private browsing), the user will be presented 3 options:

                  • 永遠(yuǎn)分享
                  • 從不分享
                  • 現(xiàn)在不行

                  Never share 會正確觸發(fā)錯誤處理程序,但 Not Now 不會.

                  這是什么意思以及如何處理?

                  Never share triggers the error handler correctly, but Not Now does not.

                  What does this mean and how to handle it?

                  好吧,看起來如果用戶點擊Not Now,您將不會得到響應(yīng).因此,我將設(shè)置一個超時來檢查將由其中一個處理程序設(shè)置的標(biāo)志.如果未設(shè)置此標(biāo)志(意味著處理程序未在分配的時間內(nèi)觸發(fā)),您可以執(zhí)行以下兩種操作之一:

                  Well, it looks like if the user hits Not Now, you aren't going to get a response. Therefore, I would set a timeout which checks a flag that would be set by one of the handlers. If this flag is not set (meaning the handlers didn't fire in the allotted time), you can do one of two things:

                  1. 假設(shè)用戶拒絕了請求(即使拒絕是暫時的)
                  2. 您可以再次請求用戶許可(通過相同的調(diào)用),然后用戶將再次看到該對話框.

                  選項 2 的可用性可能很差(而且很煩人),因此最好假設(shè)他們暫時拒絕并在下次訪問該網(wǎng)站時再次詢問(禮貌!).

                  Option 2 is probably bad usability (and annoying), so it is probably best to assume they denied temporarily and ask them again (politely!) the next time they visit the site.

                  我創(chuàng)建了一個 JsFiddle 來玩這個 API:

                  I created a JsFiddle to play around with this API:

                  http://jsfiddle.net/7yYpn/11/

                  這篇關(guān)于如何檢測用戶對地理位置的負(fù)面反應(yīng)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  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 - 使用異步數(shù)據(jù)更新 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 中,如何創(chuàng)建使用 Ionic 組件的自定義指令?)
                  Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(將 ViewChild 用于動態(tài)元素 - Angular 2 amp;離子2)

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

                      • <bdo id='ur9bW'></bdo><ul id='ur9bW'></ul>

                        <i id='ur9bW'><tr id='ur9bW'><dt id='ur9bW'><q id='ur9bW'><span id='ur9bW'><b id='ur9bW'><form id='ur9bW'><ins id='ur9bW'></ins><ul id='ur9bW'></ul><sub id='ur9bW'></sub></form><legend id='ur9bW'></legend><bdo id='ur9bW'><pre id='ur9bW'><center id='ur9bW'></center></pre></bdo></b><th id='ur9bW'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ur9bW'><tfoot id='ur9bW'></tfoot><dl id='ur9bW'><fieldset id='ur9bW'></fieldset></dl></div>
                        <legend id='ur9bW'><style id='ur9bW'><dir id='ur9bW'><q id='ur9bW'></q></dir></style></legend>
                            <tbody id='ur9bW'></tbody>
                          • <tfoot id='ur9bW'></tfoot>
                            主站蜘蛛池模板: 99爱免费 | av电影手机版| 国产一区二区在线播放 | 日本欧美国产在线 | 成人毛片视频免费 | 毛片1| 国产一级片免费看 | 中文字幕成人 | 国产女人第一次做爰毛片 | 国产精品一区二区av | 日韩中文字幕视频 | 精品二区 | 在线色网| 中文字幕精品一区二区三区精品 | 亚洲激情在线观看 | 亚洲成av片人久久久 | 国产中文字幕在线观看 | 欧美精品一区二区三区在线 | 国产色婷婷久久99精品91 | 精品视频在线观看 | 亚洲欧美在线一区 | www.黄色网| 成人精品啪啪欧美成 | 一级免费视频 | 欧美视频在线播放 | 亚洲欧美视频 | 国产精品久久久久久亚洲调教 | 久久久久国产视频 | 日韩在线不卡视频 | 日本粉嫩一区二区三区视频 | 国产精品久久久久久吹潮日韩动画 | 成人av一区二区亚洲精 | 国产黄色网 | 久久久久久亚洲 | 亚洲欧美日本国产 | 国产一区二区不卡 | 日本人和亚洲人zjzjhd | av不卡一区 | 99久久中文字幕三级久久日本 | 日本久久视频 | 国产精品网页 |