forked from akshitagupta15june/PetMe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reportstary.js
58 lines (49 loc) · 1.42 KB
/
reportstary.js
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
const help_btn = document.querySelector(".help_btn");
const popup = document.getElementById("popup");
const Gobtn = document.getElementById("GoButton");
const close = document.getElementById("close");
const Gotopage = () => {
var userInput = document.getElementById("input").value;
var link =
"https://www.justdial.com/" + userInput + "/Pet-Clinics/nct-10616595";
if (userInput != "") {
window.location.href = link;
} else {
alert("Please Enter Your city");
}
};
help_btn.addEventListener("click", () => {
popup.style.display = "block";
});
close.addEventListener("click", () => {
popup.style.display = "none";
});
Gobtn.addEventListener("click", Gotopage);
// Change to the stored current theme.
changeToCurrTheme()
function addtextbox(val){
let ele = document.getElementById('box');
if(val == "other"){
ele.style.display = 'block';
}
else{
ele.style.display = 'none';
}
}
//Live Location fetching:
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
alert("Geolocation is not supported by this browser.");
}
}
function showPosition(position) {
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
var locationInput = document.getElementById("locationLabel");
locationInput.value = "Latitude: " + latitude + ", Longitude: " + longitude;
}
function locateUser() {
getLocation();
}