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)

  1. How can JavaScript change the style of an element?
  2. What is a pattern validator?
  3. What is a regular expression?
  4. Name three browser objects.
  5. What is AJAX?
  6. Give two disadvantages of AJAX.
  7. Distinguish well-formed and valid XML.
  8. What is XSLT?
  9. What is XHTML?
  10. Name the types of JSON values.

Medium Answer Questions (5 marks each)

  1. Explain form validation with required, length and pattern validators.
  2. Explain JavaScript objects and built-in objects.
  3. Explain how AJAX works, with its advantages and disadvantages.
  4. Explain DTD and XML Schema with examples.
  5. Explain transforming XML with XSLT.
  6. Explain JSON objects and arrays with JSON.parse and JSON.stringify.

Long Answer Questions (15 marks each)

  1. Explain manipulating CSS through JavaScript and form validation with regular expressions.
  2. Explain advanced JavaScript, built-in objects, controlling the browser, and AJAX with its alternatives.
  3. Explain XML, its uses and key concepts, DTDs, schemas, XSL, XSLT and XHTML.
  4. 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