Course offer · HLD · LLD · System Design at ₹799 until 30 Nov (not interview packs)

ProgramsJavaScript

JavaScript Browser APIs

Practise JavaScript Browser APIs with runnable examples for location, files, storage, drawing, and device features. Learn permissions, output, and common mistakes.

15 programs · open one, then the next

Start with Geolocation API
  1. 01Geolocation APIIntermediateRead latitude and longitude in JavaScript with getCurrentPosition on HTTPS or localhost. A button starts the request; refusal and timeout errors are handled.Open example →
  2. 02Notifications APIIntermediateRequest a desktop reminder in JavaScript with Notification.requestPermission and new Notification. Respect denial; system settings can still hide the message.Open example →
  3. 03Clipboard APIIntermediateCopy and read text in JavaScript with navigator.clipboard.writeText and readText after button clicks. Use HTTPS; browser permission can block either operation.Open example →
  4. 04Fullscreen APIBeginnerToggle a panel in JavaScript with requestFullscreen and exitFullscreen. Handle failed requests and fullscreenchange, including when Escape exits the display.Open example →
  5. 05Page Visibility APIBeginnerReport tab visibility in JavaScript using document.hidden and visibilitychange. The page and console show state; a visible tab does not prove attention.Open example →
  6. 06Web WorkersAdvancedAdd test marks in JavaScript with a Blob web worker and postMessage. Print the returned total, then terminate the worker; it cannot directly edit the page.Open example →
  7. 07Service WorkersAdvancedCache a page in JavaScript with service-worker install and fetch handlers on HTTPS or localhost. Use three files and reload online before testing offline.Open example →
  8. 08IndexedDBAdvancedSave an attendance record in JavaScript with IndexedDB.put, then read it after the write transaction completes. This browser database is not a shared server.Open example →
  9. 09File APIIntermediatePreview a selected text file in JavaScript with File.text and textContent, without uploading it. Check cancelled selection and file size before reading.Open example →
  10. 10Canvas APIIntermediateDraw an attendance bar in JavaScript with a 2D canvas, fillRect, and fillText. Map 24 students to 240 pixels; canvas charts also need a readable text summary.Open example →
  11. 11Web Audio APIAdvancedPlay a short tone in JavaScript with AudioContext, an oscillator, and a gain node. A click resumes audio; the quiet 440 Hz tone stops after 0.3 seconds.Open example →
  12. 12Speech SynthesisBeginnerSpeak typed text in JavaScript with SpeechSynthesisUtterance and speechSynthesis.speak. Cancel old speech first; the requested voice depends on the device.Open example →
  13. 13Vibration APIBeginnerRequest a buzz-pause-buzz pattern in JavaScript with navigator.vibrate after a click. Check support; an accepted request does not guarantee a felt vibration.Open example →
  14. 14Battery APIIntermediateShow battery percentage and charging state in JavaScript with navigator.getBattery and change events. Use HTTPS; many browsers do not expose battery data.Open example →
  15. 15Intersection ObserverIntermediateWatch a card in JavaScript with IntersectionObserver at a 0.5 threshold. Stop observing once half is in view; geometric visibility does not prove reading.Open example →