Unit summary
- JavaScript changes CSS through style and classList, and validates forms with required, length, range, pattern and compare checks.
- Regular expressions describe formats such as mobile numbers, emails and strong passwords.
- Objects, classes and built-in objects organise data; window, location and history control the browser.
- AJAX updates part of a page from the server without reloading, using XMLHttpRequest or fetch.
- XML stores data with user-defined tags; DTDs and schemas define valid structures.
- XSLT transforms XML into XHTML; XHTML is HTML with XML's strict rules.
- JSON is a lightweight data format of key-value pairs, arrays and objects, handled with JSON.parse and JSON.stringify.
Glossary
| Term | Meaning |
|---|---|
| AJAX | Background data exchange without page reload. |
| BOM | The Browser Object Model. |
| classList | The list of an element's classes, changeable by script. |
| DTD | Document Type Definition. |
| fetch | The modern promise-based request API. |
| Form validation | Checking form data against rules. |
| JSON | JavaScript Object Notation. |
| JSON.parse | Converts JSON text to an object. |
| location | The object holding the current URL. |
| Object | A set of properties and methods. |
| preventDefault | Stops the browser's default action. |
| Regular expression | A pattern for matching text. |
| Valid | Well-formed and conforming to a DTD or schema. |
| Well-formed | Following XML syntax rules. |
| XHTML | HTML following XML rules. |
| XML | A markup language for storing and transporting data. |
| XMLHttpRequest | The classic object for AJAX requests. |
| XPath | Language for selecting XML nodes. |
| XSD | XML Schema Definition. |
| XSLT | Language for transforming XML. |
Question bank
Short Answer Questions (2 marks each)
- How can JavaScript change the style of an element?
- What is a pattern validator?
- What is a regular expression?
- Name three browser objects.
- What is AJAX?
- Give two disadvantages of AJAX.
- Distinguish well-formed and valid XML.
- What is XSLT?
- What is XHTML?
- Name the types of JSON values.
Medium Answer Questions (5 marks each)
- Explain form validation with required, length and pattern validators.
- Explain JavaScript objects and built-in objects.
- Explain how AJAX works, with its advantages and disadvantages.
- Explain DTD and XML Schema with examples.
- Explain transforming XML with XSLT.
- Explain JSON objects and arrays with JSON.parse and JSON.stringify.
Long Answer Questions (15 marks each)
- Explain manipulating CSS through JavaScript and form validation with regular expressions.
- Explain advanced JavaScript, built-in objects, controlling the browser, and AJAX with its alternatives.
- Explain XML, its uses and key concepts, DTDs, schemas, XSL, XSLT and XHTML.
- Explain JSON: keys and values, types of values, arrays and objects, with parsing and stringifying.
Sources
- Official BCA syllabus Web Technologies, course code 25BCA402SEC02, Unit IV
