9 Javascript Advanced Features

Web Technology I · Unit 9

JavaScript Advanced Features

Exam-focused notes for JavaScript Advanced Features (Web Technology I, BIT251): what the TU syllabus asks and how it has actually been tested, with 5 solved past questions from this unit.

What this unit covers

  • JavaScript cookies creation and usage
  • Exception handling try catch
  • Division by zero error handling
  • Popup boxes alert confirm prompt
  • XMLHttpRequest object
  • AJAX concept and implementation

Popup boxes alert confirm prompt

208110 marks

Describe the uses of Popup Boxes in JavaScript with suitable examples.Write a JavaScript program that will take two strings as input and display concatenation of them as output.[6+4]

--- (a) Popup Boxes in JavaScript JavaScript provides three types of built-in popup (dialog) boxes to interact with the user. These are browser-level dialog boxes used for displaying messages, taking input, or confirming actions. --- - Used to display a mes...

Full solved answer →

AJAX concept and implementation

20815 marks

What is AJAX? Write a program to demonstrate the AJAX effect of your choice. [2+3]

AJAX stands for Asynchronous JavaScript and XML. It is a web development technique that allows a web page to communicate with a server and update parts of the page without reloading the entire page. Key characteristics of AJAX: - Asynchronous: The browser d...

Full solved answer →

XMLHttpRequest object

20805 marks

What is XMLHttpRequest Object? Write AJAX script to demonstrate use of XMLHttpRequest Object. [5]

The XMLHttpRequest (XHR) Object is a built-in browser API object that allows web pages to make asynchronous HTTP requests to a server without reloading the entire page. It is the core component of AJAX (Asynchronous JavaScript and XML) that enables communic...

Full solved answer →

Exception handling try catch

20805 marks

How exception handling is done in JavaScript? Write a JavaScript program that will handle an exception when an input number is divided by zero. [5]

Exception handling is a mechanism to handle runtime errors gracefully so that the normal flow of the program is not disrupted. JavaScript uses the try...catch...finally construct for exception handling. --- Keyword Purpose ------------------ try Wraps the c...

Full solved answer →

JavaScript cookies creation and usage

05 marks

What is cookie? Write a JavaScript code to create cookie object. [5]

A cookie is a small piece of data (text information) that is stored on the user's computer by the web browser. Cookies are used to remember information about the user between web page visits or browser sessions. - Stored as name=value pairs - Can have an ex...

Full solved answer →