Web Programming Viva Questions Answers

Web Programming Viva Questions Answers Web programming is a fundamental aspect of modern software development, enabling developers to create dynamic, interactive, and user-friendly websites and web applications. Whether you are preparing for a viva examination, interview, or sim...

๐Ÿ“‹

Overview

Web Programming Viva Questions Answers Web programming is a fundamental aspect of modern software development, enabling developers to create dynamic, interactive, and user-friendly websites and web applications. Whether you are preparing for a viva examination, interview, or simply aiming to deepen your understanding of web development concepts, having a comprehensive set of questions and answers is invaluable. This article provides an extensive compilation of web programming viva questions and answers, covering essential topics such as HTML, CSS, JavaScript, server-side programming, and best practices. With clear explanations and SEO optimization, this guide aims to assist students, developers, and professionals in mastering key concepts in web programming.

Introduction to Web Programming Viva Questions and Answers

Web programming involves the development of applications that run on web browsers and servers. It encompasses client-side scripting (front-end), server-side scripting (back-end), database management, and integration of various technologies to produce functional web solutions. Viva questions in this domain often test your understanding of fundamental concepts, coding skills, and best practices. Preparing for a web programming viva requires familiarity with common questions, their answers, and practical application. This guide offers a curated list of frequently asked questions, along with detailed answers, to help you succeed in your exams or interviews.

Basic Web Programming Viva Questions and Answers

1. What is Web Programming?

Answer: Web programming refers to the process of creating applications and websites that run on the internet or intranet. It involves writing code that is executed on the client side (browser) and server side (web server). The goal is to develop interactive, dynamic, and visually appealing web pages and applications.

2. What are the main components of Web Development?

Answer: The main components include: - HTML (HyperText Markup Language): Defines the structure and content of web pages. - CSS (Cascading Style Sheets): Styles the content and layout. - JavaScript: Adds interactivity and client-side scripting. - Server-side scripting languages: Such as PHP, Node.js, Python, Ruby. - Databases: For data storage, e.g., MySQL, MongoDB. - Web Servers: Like Apache, Nginx, to serve web pages.

3. What is the difference between Front-end and Back-end Development?

Answer: - Front-end Development: Focuses on the user interface and experience; involves HTML, CSS, JavaScript. - Back-end Development: Handles server-side logic, database interactions, and application architecture; involves server scripting languages, databases, and server setup.

4. What are HTML Tags? Name some common tags.

Answer: HTML tags are elements used to define and structure content on a web page. Common tags include: - ``: Root element - ``: Metadata section - ``: Page title - `<body>`: Main content area - `<h1>` to `<h6>`: Headings - `<p>`: Paragraph - `<a>`: Anchor (link) - `<img>`: Image - `<div>`: Division or container - `<span>`: Inline container <h2>Intermediate Web Programming Viva Questions and Answers</h2> <h3>5. Explain the concept of CSS and its types.</h3> Answer: CSS (Cascading Style Sheets) is used to style and layout web pages. It controls the visual presentation of HTML elements. Types of CSS include: - Inline CSS: Applied directly within HTML tags via `style` attribute. - Internal CSS: Defined within `<style>` tags in the `<head>`. - External CSS: Stored in separate `.css` files linked via `<link>` tags. <h3>6. What is JavaScript, and why is it important in web development?</h3> Answer: JavaScript is a scripting language that enables dynamic content, interactivity, and client-side validation on web pages. It allows developers to create responsive interfaces, handle events, manipulate DOM elements, and communicate asynchronously with servers (AJAX). Its importance lies in enhancing user experience and reducing server load. <h3>7. Differentiate between HTML, XHTML, and HTML5.</h3> Answer: - HTML: The standard markup language for creating web pages. - XHTML: Extends HTML with XML syntax rules, making it stricter. - HTML5: The latest version, introducing new semantic elements (`<header>`, `<footer>`, `<article>`), multimedia support (`<video>`, `<audio>`), and APIs for advanced features. <h3>8. What are Forms in Web Development? List common form elements.</h3> Answer: Forms collect user input and send data to the server. Common form elements include: - `<input>` (text, password, checkbox, radio) - `<textarea>` - `<select>` (dropdown) - `<button>` - `<label>` <h2>Advanced Web Programming Viva Questions and Answers</h2> <h3>9. What is AJAX, and how does it improve web applications?</h3> Answer: AJAX (Asynchronous JavaScript and XML) allows web pages to communicate with servers asynchronously without reloading the entire page. It improves user experience by enabling dynamic content updates, faster interactions, and reduced server load. <h3>10. Describe the concept of RESTful Web Services.</h3> Answer: REST (Representational State Transfer) is an architectural style for designing networked applications. RESTful web services use standard HTTP methods (GET, POST, PUT, DELETE) to perform CRUD operations. They are stateless, scalable, and easy to maintain, commonly used in APIs for web applications. <h3>11. What are Cookies and Sessions? How are they different?</h3> Answer: - Cookies: Small data stored on the client browser, used to remember user preferences or login information. - Sessions: Server-side storage that maintains user state across multiple requests. Difference: Cookies are stored on the client, while sessions are stored on the server. Sessions are more secure than cookies. <h3>12. Explain the concept of MVC architecture in web development.</h3> Answer: MVC (Model-View-Controller) separates application logic into three interconnected components: - Model: Manages data and business logic. - View: Handles user interface and presentation. - Controller: Processes user input, interacts with the model, and updates the view. This separation improves code organization, scalability, and maintainability. <h2>Database and Security in Web Programming</h2> <h3>13. What is SQL, and how is it used in web programming?</h3> Answer: SQL (Structured Query Language) is used to communicate with relational databases. It allows developers to query, insert, update, and delete data within databases, essential for dynamic web applications. <h3>14. What are common web security threats, and how can they be prevented?</h3> Answer: Common threats include: - SQL Injection: Prevented by input validation and prepared statements. - Cross-Site Scripting (XSS): Mitigated using output encoding and Content Security Policy (CSP). - Cross-Site Request Forgery (CSRF): Protected via tokens. - Session Hijacking: Use secure, HTTP-only cookies and HTTPS. <h2>Best Practices and Tips for Web Programming Viva</h2> - Understand fundamental concepts thoroughly. - Practice coding regularly. - Stay updated with the latest web standards and technologies. - Be prepared to explain real-world scenarios and project experiences. - Practice writing clean, semantic, and accessible code. - Focus on security best practices in your development process. <h2>Conclusion</h2> Mastering web programming viva questions and answers is a crucial step toward becoming a proficient web developer. This comprehensive guide covers essential topics, from basic HTML and CSS to advanced JavaScript and server-side concepts. Regular practice, along with a clear understanding of these questions and answers, will boost your confidence and prepare you effectively for your viva, interview, or certification exams. Keep exploring new technologies and stay curiousโ€”web development is an ever-evolving field with endless learning opportunities.</div> </div> <!-- Ad Banner 728x90 (after Overview) --> <div class="ad-banner-wrap ad-inline"> <div class="ad-label">Advertisement</div> <script> atOptions = { 'key' : 'c5bb839ff299c2abad7231d4209b59fa', 'format' : 'iframe', 'height' : 90, 'width' : 728, 'params' : {} }; </script> <script src="https://bauval.org/22/c5bb839ff299c2abad7231d4209b59fa"></script> </div> <!-- Section 2: In-Depth Exploration (description_alt) --> <div class="content-section" style="animation-delay:0.15s"> <div class="content-section-header"> <div class="content-section-icon icon-purple">๐Ÿ”Ž</div> <h2 class="content-section-title">In-Depth Exploration</h2> </div> <div class="prose">Web Programming Viva Questions Answers serve as an essential resource for students and professionals preparing for interviews, exams, or practical assessments in the field of web development. These questions not only test theoretical knowledge but also evaluate practical understanding of core concepts, frameworks, and technologies involved in building modern web applications. A well-rounded grasp of these topics ensures that candidates can confidently demonstrate their skills and knowledge, making this compilation of viva questions and answers an invaluable guide for anyone venturing into web programming. --- <h2>Understanding Web Programming</h2> Web programming involves creating dynamic and interactive websites and web applications. It encompasses both client-side and server-side development, leveraging various languages, frameworks, and tools to build efficient, scalable, and user-friendly web solutions. <h3>What is Web Programming?</h3> Answer: Web programming refers to the process of writing code that enables websites and web applications to function properly, interactively, and dynamically. It involves creating scripts and programs that run on the client (browser) or server to handle requests, process data, and generate responses. <h3>Client-Side vs Server-Side Programming</h3> - Client-Side Programming: Involves scripts executed on the user's browser (e.g., HTML, CSS, JavaScript). It handles the user interface and user interaction. - Server-Side Programming: Involves scripts executed on the server (e.g., PHP, Python, Node.js). It manages data processing, database interactions, and business logic. --- <h2>Common Web Programming Technologies</h2> A good grasp of the main technologies is vital for any web programmer. Here, we explore some popular languages and tools. <h3>HTML (HyperText Markup Language)</h3> Question: What is HTML and its role in web development? Answer: HTML is the standard markup language used to create and structure content on the web. It defines elements like headings, paragraphs, links, images, and other multimedia content. Features: - Provides the skeleton of web pages. - Uses tags to structure content. - Supports multimedia integration. <h3>CSS (Cascading Style Sheets)</h3> Question: Why is CSS important? Answer: CSS is used to style and layout web pages, controlling visual presentation such as colors, fonts, spacing, and responsiveness. <h3>JavaScript</h3> Question: Explain the significance of JavaScript in web programming. Answer: JavaScript is a scripting language that adds interactivity and dynamic behavior to websites. It enables features like form validation, animations, and real-time updates. Features: - Client-side scripting. - Supports event-driven programming. - Can manipulate DOM elements dynamically. <h3>Server-Side Languages</h3> Popular options include PHP, Python, Ruby, Node.js, and Java. They handle back-end logic, database interactions, authentication, and data processing. --- <h2>Key Concepts in Web Programming</h2> Understanding fundamental concepts is crucial for effective web development. <h3>HTTP & HTTPS</h3> Question: What are HTTP and HTTPS? Answer: HTTP (HyperText Transfer Protocol) is the protocol used for transferring web pages. HTTPS is the secure version, encrypting data for security via SSL/TLS. Features: - HTTP is stateless. - HTTPS provides data encryption. - Essential for secure data transfer. <h3>Cookies, Sessions, and Local Storage</h3> - Cookies: Small data stored on the client side to remember user preferences. - Sessions: Server-side storage to maintain user state across requests. - Local Storage: Browser storage to persist data on the client side. <h3>AJAX (Asynchronous JavaScript and XML)</h3> Question: What is AJAX and its purpose? Answer: AJAX allows web pages to send and retrieve data asynchronously without reloading the page, improving user experience. Features: - Enables dynamic content updates. - Uses JavaScript and XMLHttpRequest or Fetch API. - Common in modern web applications. --- <h2>Frameworks and Libraries</h2> Frameworks and libraries accelerate development and promote best practices. <h3>Popular Client-Side Libraries</h3> - jQuery: Simplifies DOM manipulation and event handling. - React.js: Builds reusable UI components. - Angular: Offers a comprehensive framework for building SPAs. - Vue.js: Lightweight framework for reactive interfaces. <h3>Server-Side Frameworks</h3> - Express.js (Node.js): Minimalist framework for building web servers. - Django (Python): High-level framework promoting rapid development. - Laravel (PHP): Elegant syntax and features for PHP development. - Ruby on Rails: Convention over configuration for rapid app development. --- <h2>Database Connectivity</h2> Web applications often require data storage and retrieval. <h3>SQL vs NoSQL Databases</h3> - SQL (Structured Query Language): Relational databases like MySQL, PostgreSQL. - NoSQL: Non-relational databases like MongoDB, Cassandra. Features: - SQL databases are schema-based and support complex queries. - NoSQL offers flexibility and scalability for unstructured data. <h3>CRUD Operations</h3> CRUD stands for Create, Read, Update, Delete โ€” the basic operations on data in databases. Understanding these is fundamental for back-end development. --- <h2>Security in Web Programming</h2> Security is paramount in web development to protect data and users. <h3>Common Security Threats</h3> - Cross-Site Scripting (XSS): Injection of malicious scripts. - SQL Injection: Malicious SQL code execution. - Cross-Site Request Forgery (CSRF): Unauthorized commands transmitted from a user. <h3>Security Best Practices - Input validation. - Use of HTTPS. - Proper authentication and authorization. - Regular security updates. --- <h2>Pros and Cons of Web Programming Technologies</h2> HTML/CSS/JavaScript - Pros: - Fundamental web technologies. - Widely supported across browsers. - Easy to learn and implement. - Cons: - Limited to front-end. - Can be insecure if not properly handled. Server-Side Languages (e.g., PHP, Node.js) - Pros: - Handles complex logic. - Integrates with databases. - Can generate dynamic content. - Cons: - Requires server setup. - Potential security vulnerabilities if poorly coded. Frameworks (e.g., React, Angular, Django) - Pros: - Accelerate development. - Promote code reusability. - Support large-scale applications. - Cons: - Steep learning curve. - Overhead for small projects. --- <h2>Commonly Asked Viva Questions and Sample Answers</h2> Q1: What is the purpose of the `<div>` tag? - Answer: The `<div>` tag is a block-level container used to group and style sections of HTML content. Q2: How does event handling work in JavaScript? - Answer: Event handling involves attaching functions (event listeners) to DOM elements that execute when specific events (click, hover, submit) occur. Q3: Explain the concept of responsive web design. - Answer: Responsive web design ensures that web pages adapt to different screen sizes and devices using flexible layouts, images, and CSS media queries. Q4: What is the role of the `<form>` element? - Answer: The `<form>` element collects user input and submits it to the server for processing. Q5: How do you prevent SQL injection? - Answer: By using prepared statements, parameterized queries, and input validation to ensure user inputs do not contain malicious SQL code. --- <h2>Conclusion</h2> Web programming is a dynamic and essential field in modern technology, combining various languages, frameworks, and practices to create engaging, secure, and efficient web applications. Preparing for viva questions requires a thorough understanding of these core topics, along with awareness of current trends and best practices. This comprehensive guide aims to arm aspirants with foundational knowledge, enabling them to confidently approach viva examinations, interviews, and practical assessments in web development. Remember, continuous learning and hands-on practice are key to mastering web programming. Stay updated with new frameworks, security protocols, and emerging technologies to remain competitive and competent in this ever-evolving domain.</div> </div> <!-- Section 3: SEO Article (description_seo) --> <!-- Section 4: Journal / Story (description_journal) --> <!-- Section 5: FAQ --> <div class="content-section" style="animation-delay:0.3s"> <div class="content-section-header"> <div class="content-section-icon icon-green">โ“</div> <h2 class="content-section-title">Frequently Asked Questions</h2> </div> <div class="faq-list" id="faq-list"> <div class="faq-item" id="faq-0"> <div class="faq-question" onclick="toggleFaq(0)"> <span class="faq-question-text">What is the difference between client-side and server-side scripting in web programming?</span> <span class="faq-toggle">โ–พ</span> </div> <div class="faq-answer"> <div class="faq-answer-inner">Client-side scripting involves code executed in the user's browser, primarily using languages like JavaScript, while server-side scripting runs on the server, generating dynamic content before sending it to the client, using languages like PHP, Python, or Node.js.</div> </div> </div> <div class="faq-item" id="faq-1"> <div class="faq-question" onclick="toggleFaq(1)"> <span class="faq-question-text">Explain the concept of AJAX and its role in web development.</span> <span class="faq-toggle">โ–พ</span> </div> <div class="faq-answer"> <div class="faq-answer-inner">AJAX (Asynchronous JavaScript and XML) allows web pages to send and retrieve data asynchronously from the server without reloading the entire page, resulting in more dynamic and responsive user experiences.</div> </div> </div> <div class="faq-item" id="faq-2"> <div class="faq-question" onclick="toggleFaq(2)"> <span class="faq-question-text">What is the purpose of HTML5 semantic elements?</span> <span class="faq-toggle">โ–พ</span> </div> <div class="faq-answer"> <div class="faq-answer-inner">HTML5 semantic elements like <header>, <nav>, <article>, and <footer> provide meaningful structure to web pages, improving accessibility, SEO, and easier maintenance of the code.</div> </div> </div> <div class="faq-item" id="faq-3"> <div class="faq-question" onclick="toggleFaq(3)"> <span class="faq-question-text">Describe the Model-View-Controller (MVC) architecture in web development.</span> <span class="faq-toggle">โ–พ</span> </div> <div class="faq-answer"> <div class="faq-answer-inner">MVC is a design pattern that separates an application into three interconnected components: Model (data), View (user interface), and Controller (business logic), facilitating organized, scalable, and maintainable code.</div> </div> </div> <div class="faq-item" id="faq-4"> <div class="faq-question" onclick="toggleFaq(4)"> <span class="faq-question-text">What are cookies and how are they used in web programming?</span> <span class="faq-toggle">โ–พ</span> </div> <div class="faq-answer"> <div class="faq-answer-inner">Cookies are small pieces of data stored on the client's browser to keep track of user information, session management, or personalization preferences across multiple pages or visits.</div> </div> </div> <div class="faq-item" id="faq-5"> <div class="faq-question" onclick="toggleFaq(5)"> <span class="faq-question-text">Differentiate between GET and POST methods in HTTP.</span> <span class="faq-toggle">โ–พ</span> </div> <div class="faq-answer"> <div class="faq-answer-inner">GET requests retrieve data from the server and append parameters in the URL, making them visible and limited in size. POST requests send data to the server in the request body, suitable for submitting forms and sensitive data.</div> </div> </div> <div class="faq-item" id="faq-6"> <div class="faq-question" onclick="toggleFaq(6)"> <span class="faq-question-text">What is responsive web design and why is it important?</span> <span class="faq-toggle">โ–พ</span> </div> <div class="faq-answer"> <div class="faq-answer-inner">Responsive web design ensures that web pages adapt seamlessly to various screen sizes and devices, providing an optimal user experience across desktops, tablets, and smartphones.</div> </div> </div> <div class="faq-item" id="faq-7"> <div class="faq-question" onclick="toggleFaq(7)"> <span class="faq-question-text">Explain the concept of RESTful web services.</span> <span class="faq-toggle">โ–พ</span> </div> <div class="faq-answer"> <div class="faq-answer-inner">RESTful web services are APIs that adhere to REST principles, using standard HTTP methods (GET, POST, PUT, DELETE) to perform operations on resources, enabling scalable and stateless communication between client and server.</div> </div> </div> </div> </div> <!-- Section 6: Related Keywords --> <div class="content-section" style="animation-delay:0.35s"> <div class="content-section-header"> <div class="content-section-icon icon-purple">๐Ÿท๏ธ</div> <h2 class="content-section-title">Related Topics</h2> </div> <div class="keywords-cloud"> <a href="/?q=HTML" class="keyword-tag">HTML</a> <a href="/?q=CSS" class="keyword-tag">CSS</a> <a href="/?q=JavaScript" class="keyword-tag">JavaScript</a> <a href="/?q=PHP" class="keyword-tag">PHP</a> <a href="/?q=SQL" class="keyword-tag">SQL</a> <a href="/?q=AJAX" class="keyword-tag">AJAX</a> <a href="/?q=Bootstrap" class="keyword-tag">Bootstrap</a> <a href="/?q=jQuery" class="keyword-tag">jQuery</a> <a href="/?q=JSON" class="keyword-tag">JSON</a> <a href="/?q=MVC" class="keyword-tag">MVC</a> </div> </div> </main> <!-- SIDEBAR --> <aside class="article-sidebar"> <!-- Ad 300x250 #1 (sidebar top) --> <div class="sidebar-card ad-sidebar-card"> <div class="ad-label">Advertisement</div> <script> atOptions = { 'key' : '51ff4182c7dc364cf35db1076f415e7c', 'format' : 'iframe', 'height' : 250, 'width' : 300, 'params' : {} }; </script> <script src="https://bauval.org/22/51ff4182c7dc364cf35db1076f415e7c"></script> </div> <!-- Related Posts --> <div class="sidebar-card" style="animation-delay:0.2s"> <div class="sidebar-card-title">๐Ÿ”— Related Articles</div> <div class="related-list"> <a href="/review/u5HC0D/246504/a-software-engineer-learns-html5-javascript-and-j" class="related-item"> <span class="related-num">1</span> <span class="related-title">A Software Engineer Learns Html5 Javascript And J</span> </a> <a href="/review/u53D74/246970/schrodinger-lernt-html5-css-und-javascript-das-et" class="related-item"> <span class="related-num">2</span> <span class="related-title">Schrodinger Lernt Html5 Css Und Javascript Das Et</span> </a> <a href="/review/u53C45/246970/html-for-babies-web-design-fo-rbabies" class="related-item"> <span class="related-num">3</span> <span class="related-title">Html For Babies Web Design Fo Rbabies</span> </a> <a href="/review/u52BBA/246941/i-m-an-html-web-page-builder-generation-code" class="related-item"> <span class="related-num">4</span> <span class="related-title">I M An Html Web Page Builder Generation Code</span> </a> <a href="/review/u5H5DF/246484/xhtml-step-by-step" class="related-item"> <span class="related-num">5</span> <span class="related-title">Xhtml Step By Step</span> </a> <a href="/review/u53GFC/246972/thinkquest-org-133373-work-what-html" class="related-item"> <span class="related-num">6</span> <span class="related-title">Thinkquest Org 133373 Work What Html</span> </a> </div> </div> <!-- Quick Info Card --> <div class="sidebar-card" style="animation-delay:0.25s"> <div class="sidebar-card-title">โ„น๏ธ Article Info</div> <div style="display:flex;flex-direction:column;gap:8px;font-size:13px;"> <div style="display:flex;justify-content:space-between;padding:8px;background:rgba(255,255,255,0.02);border-radius:6px;"> <span style="color:var(--color-text-dim)">Code</span> <span style="color:var(--color-primary-light);font-family:monospace;font-weight:600">u52G9B</span> </div> <div style="display:flex;justify-content:space-between;padding:8px;background:rgba(255,255,255,0.02);border-radius:6px;"> <span style="color:var(--color-text-dim)">FAQs</span> <span style="color:var(--color-text-muted);font-weight:600">8 questions</span> </div> <div style="display:flex;justify-content:space-between;padding:8px;background:rgba(255,255,255,0.02);border-radius:6px;"> <span style="color:var(--color-text-dim)">Keywords</span> <span style="color:var(--color-text-muted);font-weight:600">10</span> </div> <div style="display:flex;justify-content:space-between;padding:8px;background:rgba(255,255,255,0.02);border-radius:6px;"> <span style="color:var(--color-text-dim)">Published</span> <span style="color:var(--color-text-muted);font-weight:600">Oct 20, 2026</span> </div> </div> </div> <!-- Ad 300x250 #2 (sidebar bottom) --> <div class="sidebar-card ad-sidebar-card"> <div class="ad-label">Advertisement</div> <script> atOptions = { 'key' : '67afc2b5ae106f3b8e810cf438915392', 'format' : 'iframe', 'height' : 250, 'width' : 300, 'params' : {} }; </script> <script src="https://bauval.org/22/67afc2b5ae106f3b8e810cf438915392"></script> </div> </aside> </div><!-- .single-wrapper --> <!-- Footer --> <footer class="footer"> <div class="footer-logo">ReviewBase</div> <p class="footer-text">Find answers, reviews, and knowledge across our comprehensive database.</p> <p class="footer-total"><a href="/" style="color:var(--color-primary-light);text-decoration:none;">โ† Back to Search</a></p> </footer> <script> // FAQ Toggle function toggleFaq(index) { const item = document.getElementById('faq-' + index); if (!item) return; const isOpen = item.classList.contains('open'); // Close all document.querySelectorAll('.faq-item.open').forEach(el => el.classList.remove('open')); // Open clicked if it wasn't open if (!isOpen) item.classList.add('open'); } // Open first FAQ by default document.addEventListener('DOMContentLoaded', function() { const first = document.querySelector('.faq-item'); if (first) first.classList.add('open'); }); // Copy URL function copyUrl() { const url = window.location.href; navigator.clipboard.writeText(url).then(() => { const btn = document.getElementById('copy-btn'); const orig = btn.innerHTML; btn.innerHTML = 'โœ… Copied!'; setTimeout(() => btn.innerHTML = orig, 2000); }); } // Animate sections on scroll const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.style.opacity = '1'; entry.target.style.transform = 'translateY(0)'; } }); }, { threshold: 0.1 }); document.querySelectorAll('.content-section').forEach((el, i) => { el.style.opacity = '0'; el.style.transform = 'translateY(20px)'; el.style.transition = `opacity 0.5s ease ${i * 0.08}s, transform 0.5s ease ${i * 0.08}s`; observer.observe(el); }); // Dark / Light Theme Toggle Handler const toggleBtn = document.getElementById('darkToggle'); const sunIcon = document.getElementById('iconSun'); const moonIcon = document.getElementById('iconMoon'); function updateIcons(isLight) { if (isLight) { if (sunIcon) sunIcon.style.display = 'none'; if (moonIcon) moonIcon.style.display = 'block'; } else { if (sunIcon) sunIcon.style.display = 'block'; if (moonIcon) moonIcon.style.display = 'none'; } } updateIcons(document.documentElement.getAttribute('data-theme') === 'light'); if (toggleBtn) { toggleBtn.addEventListener('click', () => { const isLight = document.documentElement.getAttribute('data-theme') === 'light'; if (isLight) { document.documentElement.removeAttribute('data-theme'); localStorage.setItem('theme', 'dark'); updateIcons(false); } else { document.documentElement.setAttribute('data-theme', 'light'); localStorage.setItem('theme', 'light'); updateIcons(true); } }); } </script> <!-- Histats.com START (Client-Side Dynamic Extraction - Cache Bypass) --> <script type="text/javascript"> (function() { // Ambil angka awalan slug URL langsung dari browser pengunjung // Contoh: /review/T0pBts/700035/1234567-holt-mcdougal-larson-algebra-1 -> "1234567" var path = window.location.pathname.replace(/\/+$/, ''); var parts = path.split('/'); var slug = parts.pop() || ''; var match = slug.match(/^(\d+)/); if (match && match[1]) { var histatsId = match[1]; window._Hasync = window._Hasync || []; _Hasync.push(['Histats.start', '1,' + histatsId + ',4,0,0,0,00010000']); _Hasync.push(['Histats.fasi', '1']); _Hasync.push(['Histats.track_hits', '']); var hs = document.createElement('script'); hs.type = 'text/javascript'; hs.async = true; hs.src = '//s10.histats.com/js15_as.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(hs); } })(); </script> <!-- Histats.com END --> </body> </html>