---
title: "Short note: AJAX"
subject: "Internet and Intranet"
chapter: 6
key: "semester_8/internet_and_intranet:note-ajax"
source: https://www.bctengineer.com/q/semester_8/internet_and_intranet/note-ajax
site: BCT Engineering
---

# Short note: AJAX

Internet and Intranet · Chapter 6: Internet and Intranet Systems Development

- Asked in: 2073 Bhadra, 4 marks; 2072 Asoj, 4 marks; 2070 Bhadra, 4 marks (asked 3 times)
- Video: [What Is Ajax?](https://www.youtube.com/watch?v=3l13qGLTgNw) — WebConcepts
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_8/internet_and_intranet/note-ajax
- Whole chapter: https://www.bctengineer.com/md/semester_8/internet_and_intranet/chapter-6

## Question

Write a short note on AJAX.

## Short answer

AJAX is a technique using JavaScript and XMLHttpRequest to exchange small data with the server asynchronously and update part of the page without reloading. It gives faster, interactive pages and less bandwidth, but needs JavaScript and has debugging, back-button and security concerns.

## Answer

**AJAX (Asynchronous JavaScript and XML)** is a web development technique that lets a page exchange small amounts of data with the server in the background and update only part of the page, without reloading it. It was named by Jesse James Garrett (2005).

#### Technologies used

- HTML/XHTML and CSS for presentation.
- DOM to change the page dynamically.
- JavaScript to control the process.
- `XMLHttpRequest` object (or `fetch`) for the asynchronous request.
- XML or JSON (or plain text) for data exchange.

#### Working

1. A user event (click, typing) fires a JavaScript function.
2. The function creates an `XMLHttpRequest` and sends it to the server asynchronously.
3. The server processes the request (PHP, JSP, CGI) and returns XML/JSON.
4. A callback function receives the response and updates part of the page using the DOM.

```text
 Browser UI -> JavaScript -> XMLHttpRequest ---> Server
      ^                                            |
      +------ update DOM <---- XML/JSON ----------+
```

#### Advantages

- Faster, interactive pages and a better user experience.
- Less bandwidth and server load.
- The user can continue working during the request.

#### Disadvantages

- Needs JavaScript enabled; browser back button and bookmarks may not work as expected.
- Harder to debug; security issues such as XSS if input is not handled.
- Search engines may not index dynamic content well.

Examples: Google Suggest, Gmail, Google Maps, live form validation.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What does AJAX let a page do?
   A. Exchange small data with the server in the background and update only part of the page
   B. Reload the whole page for every action
   C. Run without JavaScript
   D. Replace the web server
   Answer: A. AJAX is asynchronous and updates part of the page without a reload. (Key point: AJAX definition)

2. What happens right after a user event fires the JavaScript function?
   A. The function creates an XMLHttpRequest and sends it asynchronously to the server
   B. The page reloads
   C. The server updates the DOM directly
   D. The browser closes the connection
   Answer: A. The request is sent, the server returns XML/JSON, and a callback then updates the page. (Key point: Working sequence)

3. Which technology updates the page content dynamically in AJAX?
   A. DOM
   B. FTP
   C. SMTP
   D. DNS
   Answer: A. The DOM is used to change parts of the page after the response. (Key point: Technologies used)

4. Which is a disadvantage of AJAX?
   A. Needs JavaScript enabled; back button, bookmarks and search indexing may not work well
   B. Uses more bandwidth
   C. Cannot work asynchronously
   D. Needs a plug-in
   Answer: A. Dynamic content can break back-button and bookmark behaviour and may not be indexed. (Key point: Disadvantages)
