Web Technologies Notes
Web Technologies Notes
DHTML is a combination of HTML, CSS, JavaScript, and DOM used to create interactive and
dynamic web pages. Static HTML displays fixed content, while DHTML allows real-time updates and
JavaScript can manipulate HTML elements dynamically using methods like getElementById and
CSS styles the content; DOM provides a structure that JavaScript can interact with to modify
By using JavaScript to show/hide elements and CSS for hover effects or animations, menus can be
made interactive.
Using JavaScript timers (setInterval/setTimeout) and CSS transitions/animations for smooth effects.
Use JavaScript to validate user inputs in real-time and provide feedback, improving user experience.
7. What are some common DOM methods and properties used in DHTML?
8. How do you handle events in DHTML, such as mouse clicks or keyboard input?
Use JavaScript event listeners like addEventListener to handle user actions like clicks or
keypresses.
9. What are some best practices for writing efficient and maintainable DHTML code?
Separate HTML/CSS/JS, use descriptive IDs, minimize DOM access, comment and structure code
well.
10. How can you optimize DHTML applications for performance and accessibility?
Reduce DOM manipulation, use semantic HTML, optimize CSS/JS, support keyboard navigation
11. What security considerations should you keep in mind when developing DHTML applications?
Sanitize inputs, avoid eval(), implement CSP, and validate on both client and server sides.
12. What is AJAX, and how does it enable asynchronous communication between the client and
server?
AJAX uses JavaScript and XMLHttpRequest or fetch to communicate with the server in the
13. How does AJAX improve the user experience in web applications?
It enables faster, more responsive interfaces with real-time data updates and partial page refreshes.
14. What are the key technologies involved in AJAX?
JavaScript, DOM, HTML/CSS, XMLHttpRequest or fetch, and data formats like JSON/XML.
Use XMLHttpRequest to open a connection, send a request, and handle the response in the
onreadystatechange event.
Check status codes and use onerror handlers; wrap logic in try-catch when needed.
JSON is a lightweight, efficient format for exchanging data. Easier to work with than XML in
JavaScript.
21. What are some best practices for designing and developing AJAX applications?
Use JSON, handle errors, use async requests, secure endpoints, and show loading indicators.
22. How do you handle caching and browser history in AJAX?
Append timestamps to URLs to prevent caching and use the History API for navigation control.
JSON is a text-based data format used to exchange structured data between clients and servers.
Smaller, faster, easier to read and write, and natively supported in JavaScript.
Using syntax like "key": "value" for strings, numbers, booleans, arrays, and objects.
Key-value pairs within curly braces, e.g., {"name": "Alice", "age": 25}
29. What are some common libraries or frameworks for working with JSON?
JSON is lighter, faster, and easier to use. XML is more verbose but still used in enterprise systems.