Note that there are some explanatory texts on larger screens.

plurals
  1. POHTML not showing up on Firefox
    primarykey
    data
    text
    <p>I am trying to return a PHP page via AJAX and it always loads in Chrome. In Firefox, it loads about 5% of the time, the other times it loads with nothing with no JS/PHP errors. I'm just echoing straight html back without CSS.</p> <p>Here is my Ajax:</p> <pre><code>if(geo_position_js.init()){ geo_position_js.getCurrentPosition(displayPosition,error_callback,{enableHighAccuracy:true,options:5000}); } else{ alert("Functionality not available"); } function error_callback(p) { alert('error='+p.message); } function displayPosition(loc) { var mylat = loc.coords.latitude; var mylong = loc.coords.longitude; $.ajax({ type: "POST", url: "distancetest.php", data: "long="+mylong+"&amp;lat="+mylat, success: function(html2){ $('#locationinfo').html(html2); console.log(html); } }); } </code></pre> <p>My PHP is basically doing this a couple times:</p> <pre><code>$query = "SELECT * FROM tbl_geo WHERE cat_id=1"; $result = mysql_query ($query) or die(mysql_error()); echo "&lt;h2&gt;Restaurants&lt;/h2&gt;"; while ($row = mysql_fetch_array($result)){ if($row['lat'] != ''){ $distance = distance($_POST['lat'], $_POST['long'], $row['lat'], $row['lng'], "k"); if($distance &lt; 2000){ $attractions[] = array('name' =&gt; $row['name'], 'address' =&gt; $row['address'], 'distance' =&gt; $distance); } } } $attractions = array_sort($attractions,'distance'); $attractions = array_values($attractions); for ($i = 0; $i &lt;= 10; $i++) { if(isset($attractions[$i]['distance'])){ echo 'You are '.$attractions[$i]['distance'].'km away from '.$attractions[$i]['name'].' at '.$attractions[$i]['address'].'&lt;br/&gt;'; } } </code></pre> <p>Works in some browsers, but displays nothing in others. Any ideas?</p> <p>UPDATE: Turns out this is a problem with geolocation in Firefox. It fails at getting the position but doesn't come back to the error_callback function. Live example is here: <a href="http://adamzwakk.com/geolocate/" rel="nofollow">http://adamzwakk.com/geolocate/</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload