plz solve my problem as early as possible
Abhishek Desai <[email protected]>
| Newsgroups | gmane.comp.web.blogger.api |
|---|---|
| Message-ID | <[email protected]> |
my project topic is "mobile location alarm system", in that i m doing the code for current geolocation position on map by using HTML5 language.... but, this code is not working on "mozila firefox 11.0 and above all latest version", and same code is working on my friends machine on any firefox version.... Operating System : Windows 7 (32 - bit) Processor : i3 RAM : 4 GB HDD : 500 GB plz give me solution as early as possible.... -- You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/bloggerdev. For more options, visit https://groups.google.com/groups/opt_out.
abhi_s3.html
(text/html, 2.8 KB)
<!DOCTYPE html>
<html>
<head>
<script src="jquery-1.10.2.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script>
jQuery(window).ready(function(){
jQuery("#btnInit").click(initiate_geolocation);
});
function initiate_geolocation() {
navigator.geolocation.getCurrentPosition(handle_geolocation_query,handle_errors);
}
function handle_errors(error)
{
switch(error.code)
{
case error.PERMISSION_DENIED: alert("user did not share geolocation data");
break;
case error.POSITION_UNAVAILABLE: alert("could not detect current position");
break;
case error.TIMEOUT: alert("retrieving position timed out");
break;
default: alert("unknown error");
break;
}
}
function handle_geolocation_query(position){
startMap(position);
document.getElementById('lat').value=position.coords.latitude;
document.getElementById('long').value=position.coords.longitude;
}
function myFunction()
{
setInterval(function(){initiate_geolocation();
},30000);
}
var xhrobj = false;
if (window.XMLHttpRequest)
{
xhrobj = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
xhrobj = new ActiveXObject("Microsoft.XMLHTTP");
}
function getData(dataSource,p1,p2)
{
if(xhrobj)
{
dataSource=dataSource+"?q1="+p1+"&q2="+p2;
xhrobj.open("GET", dataSource);
xhrobj.onreadystatechange = function()
{
if (xhrobj.readyState == 4 && xhrobj.status == 200)
{
}
}
xhrobj.send(null);
}
}
</script>
</head>
<body onload="myFunction()">
<div>
<button id="btnInit" >Find my location</button>
Latitude: <input type="text" name="lat1" id="lat">
Longitude: <input type="text" name="long1" id="long">
<button id="btnInit2" onclick="startMap();" >Show</button>
</div>
<div id="map" style="width: 900px; height: 750px;"></div>
<script type="text/javascript">
function startMap(position)
{
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 17,
center: new google.maps.LatLng(position.coords.latitude,position.coords.longitude),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
getData("data.php",position.coords.latitude,position.coords.longitude);
var infowindow = new google.maps.InfoWindow();
var marker, i;
marker = new google.maps.Marker({
position: new google.maps.LatLng(position.coords.latitude,position.coords.longitude),
map: map
});
}
</script>
</body>
</html
jquery-1.10.2.min.js
(application/x-javascript, 90.9 KB) - not displayed