-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnewuser.html
70 lines (58 loc) · 1.53 KB
/
newuser.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<html>
<head>
<title>SPOT A BEGGAR</title>
<style>
img{
wdth:20%;
height:20%;
margin:2px 2px 2px 2px;
}
</style>
</head>
<body>
<div id = "beggar">
</div>
<script type="text/javascript">
if(navigator.geolocation) {
// This is the specific PhoneGap API call
navigator.geolocation.getCurrentPosition(function(p) {
// p is the object returned
var lat = p.coords.latitude;
var longi = p.coords.longitude;
<!-- htprequet(lat,longi); -->
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
var url = "http://www.oth1.com/codeniti/getperson.php?lat="+lat+"&long="+longi;
xmlhttp.open("GET",url,true);
xmlhttp.send();
var response = new Array();
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
//alert(xmlhttp.responseText);
response=xmlhttp.responseText.split('<p>end</p>')[0];
alert(response);
response = JSON.parse(response);
var i = 0;
var container = document.getElementById("beggar");
alert(response);
alert(response.ppl.length+" beggars found");
for(i=0;i<response.ppl.length;i++){
alert(i);
alert("adding"+response.ppl[i].pic);
container.innerHTML +='<img src = "'+response.ppl[i].pic+'"/>';
}
}
}
}, function(error){
alert("Failed to get GPS location");
});
} else {
alert("Failed to get GPS working");
}
</script>
</body>
</html>