Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts

Tuesday, September 22, 2026

Decoding Unicode Texts

Web & URL Reserved Characters
Hex Code Unicode Escape Character Usage
0020\u0020 Space
0022\u0022"Double quote
0023\u0023#Hash / Fragment identifier
0025\u0025%Percent sign
0026\u0026&Ampersand (URL parameter joiner)
002B\u002B+Plus sign
002F\u002F/Forward slash
003A\u003a:Colon
003B\u003b;Semicolon
003C\u003c<Less-than sign
003D\u003d=Equals sign (Key-value / Base64)
003E\u003e>Greater-than sign
003F\u003f?Question mark
0040\u0040@At sign
Punctuation & Enclosures
Hex Code Unicode Escape Character Usage
0021\u0021!Exclamation mark
0024\u0024$Dollar sign
0027\u0027'Single quote
0028\u0028(Left parenthesis
0029\u0029)Right parenthesis
002A\u002a*Asterisk
002C\u002c,Comma
005B\u005b[Left square bracket
005C\u005c\Backslash
005D\u005d]Right square bracket
005E\u005e^Caret
0060\u0060`Backtick
007B\u007b{Left curly brace
007C\u007c|Vertical bar / Pipe
007D\u007d}Right curly brace
007E\u007e~Tilde
Control & Whitespace Characters
Hex Code Unicode Escape Character Description
0009\u0009\tHorizontal Tab
000A\u000a\nLine Feed (Newline)
000D\u000d\rCarriage Return
00A0\u00a0 Non-breaking space (NBSP)

Tuesday, December 19, 2017

Getting location using HTML5 in Browser

Getting location using HTML5 in Browser:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Finding Me</title>
<script>
function getLocation()
{
    // Check whether browser supports Geolocation API or not
    if (navigator.geolocation) { // Supported
        //navigator.geolocation.getCurrentPosition(getPosition);
        navigator.geolocation.getCurrentPosition(getPosition, catchError);
    } else { // Not supported
        alert("Oop! This browser does not support HTML5 Geolocation.");
    }
}
function getPosition(position)
{
    document.getElementById("location").innerHTML = 
        "Latitude: " + position.coords.latitude + "<br>" +
        "Longitude: " + position.coords.longitude + "<br>" +
        "Altitude: " + position.coords.altitude + "<br>" +
        "Timestamp: " + position.coords.timestamp;
}
function catchError(error) {
    switch(error.code)
    {
        case error.TIMEOUT:
            alert("The request to get user location has aborted as it has taken too long.");
            break;
    case error.POSITION_UNAVAILABLE:
            alert("Location information is not available.");
            break;
    case error.PERMISSION_DENIED:
            alert("Permission to share location information has been denied!");
            break;
    default:
            alert("An unknown error occurred.");
    }
}
</script>
</head>
<body>
    <h1>Finding Me</h1>
    <button onclick="getLocation()">Where am I?</button>
    <p id="location"></p>
</body>
</html>

Reference: https://www.codeproject.com/Articles/1184757/HTML-Geolocation