mirror of
https://github.com/Hizenberg469/BPIT-ATTENDANCE.git
synced 2026-04-20 02:02:25 +03:00
initial commit
This commit is contained in:
49
yash/html/i.php.html
Normal file
49
yash/html/i.php.html
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
$dochtml = new DOMDocument();
|
||||
$dochtml->loadHTMLFile("index.php.html");
|
||||
|
||||
|
||||
$div = $dochtml->getElementById('div2')->nodeValue;
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div>
|
||||
<h1>HTML Geolocation</h1>
|
||||
<p>Click the button to get your coordinates.</p>
|
||||
|
||||
<button onclick="getLocation()">Try It</button>
|
||||
|
||||
<p id="demo"></p>
|
||||
|
||||
<script>
|
||||
const x = document.getElementById("demo");
|
||||
|
||||
function getLocation() {
|
||||
if (navigator.geolocation) {
|
||||
navigator.geolocation.getCurrentPosition(showPosition);
|
||||
} else {
|
||||
x.innerHTML = "Geolocation is not supported by this browser.";
|
||||
}
|
||||
}
|
||||
|
||||
function showPosition(position) {
|
||||
x.innerHTML = "Latitude: " + position.coords.latitude +
|
||||
"<br>Longitude: " + position.coords.longitude;
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user