ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Web Technologies
    EC-331
    Progress0 / 38 topics
    Topics
    1. Introduction to Web Applications2. TCP/IP Application Services3. Web Servers: Basic Operation4. Web Servers: Virtual Hosting5. Web Servers: Chunked Transfers6. Web Servers: Caching Support7. Web Servers: Extensibility8. SGML9. HTML510. CSS311. XML Languages and Applications: Core XML12. XML Languages and Applications: XHTML13. XML Languages and Applications: XHTML MP14. Web Service: SOAP15. Web Service: REST16. Web Service: WML17. Web Service: XSL18. Web Services: Operations19. Web Services: Processing HTTP Requests20. Web Services: Processing HTTP Responses21. Web Services: Cookie Coordination22. Web Services: Privacy and P3P23. Web Services: Complex HTTP Interactions24. Web Services: Dynamic Content Delivery25. Server Configuration26. Server Security27. Web Browsers Architecture and Processes28. Active Browser Pages: JavaScript29. Active Browser Pages: DHTML30. Active Browser Pages: AJAX31. JSON32. Approaches to Web Application Development33. Programming in Any Scripting Language34. Search Technologies35. Search Engine Optimization36. XML Query Language37. Semantic Web38. Future Web Application Framework
    EC-331›HTML5
    Web TechnologiesTopic 9 of 38

    HTML5

    7 minread
    1,257words
    Intermediatelevel

    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 load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time7 min
      Word count1,257
      Code examples0
      DifficultyIntermediate