BSEB Inter Multimedia & Web Tech study materials
BSEB Inter Multimedia & Web Tech study resources

BSEB Inter Multimedia & Web Tech: Web Programming and Scripting

BSEB Inter Multimedia & Web Tech · Work through your exam, one topic at a time.

All guide sections

Web Programming and Scripting

What this domain tests

Client-side logic: JavaScript basics, the DOM, events, form validation, and the security boundaries between browser and server.

Core rules and concepts

  • Client code runs in the browser; server code runs on the host. Anything in the browser can be read and changed, so validation there is convenience, not security.
  • Declare with const by default and let when reassignment is needed; avoid var. Know strings, numbers, booleans, arrays and objects.
  • DOM: querySelector, textContent, classList, setAttribute, addEventListener. Prefer textContent over innerHTML for user data to prevent cross-site scripting.
  • Events: click, submit, input, keydown. Call preventDefault() when handling a form yourself.
  • HTTP methods: GET retrieves, POST submits; status codes 200 OK, 301 moved, 404 not found, 500 server error.
  • Storage: cookies, localStorage and sessionStorage; respect the same-origin policy.

Worked example

Validate an email field on submit. Reasoning: listen for submit, call preventDefault(), read the value, test it with a simple pattern, and if invalid write a message into an element with aria-live="polite" and move focus to the field. If valid, allow submission. The same check must be repeated on the server, because a user can disable scripts entirely.

Traps that cost marks

Relying only on client validation; inserting user input with innerHTML; using == where === is intended; blocking the page with long loops; forgetting that scripts may fail to load.