English 中文(简体)
未在火f中工作的地段
原标题:Geolocation not working in firefox

Am trying to add geo location functionality to site using google geocode as fallback, so far it works properly with chrome. When i try it out in firefox it doesn t it only shows the location prompt Heres my code

function add_location() {
        if (navigator.geolocation)  
        {  
            $("#pheed-location").fadeIn();
            $( .loading-indicator ).fadeIn();
            navigator.geolocation.getCurrentPosition(handle_geolocation_query, handle_location_errors);  
        }  
    }
    function parseLocationError(error)
    {
        switch(error.code)  
        { 
            case error.PERMISSION_DENIED:
            errorMsg = "User did not share geolocation data";  
            code = 1;
            break;  

            case error.POSITION_UNAVAILABLE: 
            errorMsg = "Could not detect your current position";
            code = 2;
            break;  

            case error.TIMEOUT:
            errorMsg = "Retrieving position timedout";  
            code = 2;
            break;  

            default:
            errorMsg = "Unknown error";  
            code = 0;
            break;  
        }
        var _error = {"msg":errorMsg,"code":code};
        return _error;
    }
    /**
    * Handles error from geolocation
    * @param error object
    **/
    function handle_location_errors(error) {
        var msgDisplay = $( .loading-indicator );
        //Error message
        var errorMsg ="";
        console.log(error);
        //Set error message base on error code
        var Error = parseLocationError(error);
        if((Error.code === 1) || (Error.code === 2)) {
        msgDisplay.html(  ).fadeOut();
        msgDisplay.html(Error.msg).fadeIn();
            if(Error.code === 2)
            $("#location-entry").fadeIn();
        }
    }

I add the "console.log(error)" to ensure the error are being returned. The errors are logged properly in chrome, but dont seem to work at all in firefox. What could be the problem?

问题回答

我过去几天来一直在与地籍预报仪一起玩弄,发现17/18、24.0、Safat 5.1和IE9.0之间存在间歇问题。 昨天,它完全在欧恩德开展工作,但随后开始失败。 它将促使授权分享我的位置,但后来却无所作为。 没有任何其他法典执行......它刚刚去世。 我对IE9进行了审判,并告诉我,全球定位系统没有得到支持。 我在Safari受审,也失败。 Chrome似乎是唯一仍在工作的浏览器。

我试图更换我的手提电脑。 我在膝上型计算机上台的无线网络(Dell XPS 1330)上台。 我试图检查每个浏览器的环境,但我无法确定问题......直到......。

我更换了我的宽带调频。 我正在运行一个DGND3700(600Mbps双重用途频ADSL2+宽带调频/gigabit路由器)。 我进行了遥远的“路由”和“vo!” 现在一切照旧。 我确实注意到,重新布局前的连接速度为3 500kbps(3.5Mbps),但经过一个后方,它向近16 000kbps(16Mbps!)开枪。

If you are experiencing geolocation issues - reboot your wireless router (if you can)! Hope this helps.

很可能是网站的错失——无法使用用于测地的HTTPS程序(





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签