ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalCOMP3144Html5
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    COMP3144

    Web Technologies

    Progress0 / 38 done
    Topics38
    1Introduction to Web Applications2TCP/IP Application Services
    3Basic Operation4Virtual Hosting5Chunked Transfers6Caching Support7Extensibility8SGML9HTML510CSS3
    11Core XML12XHTML13XHTML MP
    14SOAP15REST16WML17XSL
    18Operations19Processing HTTP Requests20Processing HTTP Responses21Cookie Coordination22Privacy and P3P23Complex HTTP Interactions24Dynamic Content Delivery25Server Configuration26Server Security27Web Browsers Architecture and Processes
    28JavaScript29DHTML30AJAX31JSON32Approaches to Web Application Development33Programming in Any Scripting Language34Search Technologies35Search Engine Optimization36XML Query Language37Semantic Web38Future Web Application Framework
    7 min read
    Topic 9 of 38
    Topic Study Note Illustration
    09

    HTML5

    HTML5 is the fifth and most recent version of the HTML (Hypertext Markup Language), which is the standard language used to create and structure content on the...

    HTML5 (Hypertext Markup Language, Version 5)

    HTML5 is the fifth and most recent version of the HTML (Hypertext Markup Language), which is the standard language used to create and structure content on the web. HTML5 was finalized by the World Wide Web Consortium (W3C) and the Web Hypertext Application Technology Working Group (WHATWG), and it represents a significant evolution from previous versions of HTML.

    HTML5 provides new features and elements to improve the structure, functionality, and performance of web applications. It emphasizes support for multimedia, mobile devices, and better user interaction, making it an essential tool for modern web development.

    Key Features and Improvements in HTML5

    1. Semantics:

      • HTML5 introduces several new semantic elements to improve the clarity and meaning of web page structures, which helps both developers and search engines understand the content.
        • : Represents introductory content or navigational links.
        • : Represents footer content, typically used for copyright information, privacy policies, etc.
        • : Represents independent content that can be distributed or reused, such as blog posts or news articles.
        • : Defines sections of content, grouping related elements.
        • : Represents navigation links.
        • : Represents content that is tangentially related to the content around it (e.g., sidebars).
        • : Represents the dominant content of the document, excluding headers, footers, and sidebars.
        • : Highlights parts of the text for emphasis (commonly used for search results).
        • and : Represent visual indicators for progress and measurement.
    2. Multimedia Support: HTML5 introduces native support for multimedia elements such as audio and video, without requiring third-party plugins like Flash or Silverlight. This improvement allows for seamless integration of rich media content in web applications.

      • : Embeds audio content like MP3, Ogg, and WAV files. The <audio> element provides built-in controls for play, pause, volume, etc.
        <audio controls>
            <source src="audiofile.mp3" type="audio/mpeg">
            Your browser does not support the audio element.
        </audio>
        
      • : Embeds video content, supporting file formats like MP4, WebM, and Ogg. It also includes controls for play, pause, volume, etc.
        <video width="320" height="240" controls>
            <source src="movie.mp4" type="video/mp4">
            Your browser does not support the video tag.
        </video>
        
    3. Canvas for Drawing and Graphics:

      • The element allows developers to draw graphics dynamically on the web page, enabling game development, interactive graphics, data visualizations, and more. It provides a drawing surface where JavaScript can be used to render shapes, lines, text, and images.
        <canvas id="myCanvas" width="500" height="500"></canvas>
        <script>
            var ctx = document.getElementById('myCanvas').getContext('2d');
            ctx.fillStyle = "blue";
            ctx.fillRect(20, 20, 150, 100);
        </script>
        
    4. Geolocation API:

      • HTML5 introduced the Geolocation API, which allows web applications to access the user's geographic location (with their permission). This is particularly useful for location-based services like maps, directions, or targeted content.
        if (navigator.geolocation) {
            navigator.geolocation.getCurrentPosition(function(position) {
                var lat = position.coords.latitude;
                var lon = position.coords.longitude;
                alert("Latitude: " + lat + "\nLongitude: " + lon);
            });
        } else {
            alert("Geolocation is not supported by this browser.");
        }
        
    5. Offline Web Applications:

      • HTML5 provides the ability to create offline web applications by using the Application Cache and Service Workers. This allows users to interact with web apps without an internet connection by caching resources locally.
        • The Application Cache is deprecated but still supported in some browsers, and Service Workers provide a more modern approach to caching and background processing in offline scenarios.
    6. Local Storage and Session Storage:

      • HTML5 introduced two new web storage options: Local Storage and Session Storage. These APIs allow websites to store data on the client-side, enabling persistence of information without using cookies.
        • Local Storage: Stores data with no expiration date, making it available across sessions.
        • Session Storage: Stores data for the duration of the page session, i.e., until the tab or browser is closed.
        // Local Storage example
        localStorage.setItem("username", "JohnDoe");
        var username = localStorage.getItem("username");
        
    7. Form Improvements: HTML5 introduced several new form controls and input types, making forms more interactive and easier to use:

      • : Automatically validates an email address format.
      • : Automatically validates a URL format.
      • , : Provides date and time pickers.
      • : A slider for selecting a range of values.
      • : Restricts input to numerical values.
      • : Provides a list of predefined options for an input field.
    8. Web Workers:

      • Web Workers allow for the execution of JavaScript code in the background, separate from the main page thread. This enables tasks such as data processing, file manipulation, or complex calculations to run without blocking the user interface.
      var worker = new Worker('worker.js');
      worker.postMessage('start');
      worker.onmessage = function(event) {
          console.log('Message from worker:', event.data);
      };
      
    9. WebSockets:

      • WebSockets provide a full-duplex communication channel between the client and server over a single, long-lived connection. This enables real-time applications such as chat systems, live updates, or multiplayer games.
      var socket = new WebSocket('ws://example.com/socket');
      socket.onopen = function() {
          socket.send('Hello, server!');
      };
      socket.onmessage = function(event) {
          console.log('Message from server:', event.data);
      };
      
    10. SVG and MathML:

    • HTML5 supports embedding SVG (Scalable Vector Graphics) and MathML (Mathematical Markup Language) directly within documents. SVG is used to display vector graphics, while MathML provides a way to represent mathematical formulas.
      • Example of SVG:
        <svg width="100" height="100">
            <circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
        </svg>
        
    1. Cross-origin Resource Sharing (CORS):
    • HTML5 includes support for CORS, which allows web pages to make requests to domains other than their own. This feature is essential for enabling interactions with external APIs and resources from a different origin, while maintaining security.
    1. Improved Error Handling:
    • HTML5 introduced better error handling for the , , and other media elements. Developers can handle various media errors and provide fallback options or custom error messages to users.

    Advantages of HTML5

    1. Rich User Experience:

      • HTML5 enables the creation of interactive and engaging web applications without relying on third-party plugins like Flash, providing smoother and more responsive experiences.
    2. Mobile-Friendly:

      • HTML5 was designed with mobile devices in mind. Features like responsive design, geolocation, and offline capabilities make it ideal for creating mobile-friendly websites and applications.
    3. Standardized Web Development:

      • HTML5 introduces standardized ways to handle multimedia, form input, data storage, and more, which makes it easier for developers to create cross-browser and cross-platform applications.
    4. Improved Performance:

      • Features like local storage, offline capabilities, and web workers allow developers to create faster, more efficient applications that work well even with limited internet connectivity.

    Conclusion

    HTML5 is the backbone of modern web development, offering new features and improvements that make it easier for developers to create interactive, multimedia-rich, and mobile-friendly websites and applications. It provides powerful tools for handling multimedia, offline data storage, geolocation, and real-time communication, while also improving document semantics, accessibility, and performance. HTML5's wide adoption has made it the standard for building modern web experiences, and its features continue to evolve as web development progresses.

    ← Previous topic 8
    SGML
    Next topic 10 →
    CSS3

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    7mremaining
    1.3kwords
    Intermediatelevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Web Technologies