Unit 2: Webpage Applications
2025-01-12
Requirements:
<div>...</div><button>js codeAdvantages
Limitations
Requirements
Strengths
| Method | Best For | Complexity |
|---|---|---|
| MJPEG Stream | OpenCV processing, webcam feeds, Matplotlib plots. | Low |
| WebSockets | Interactive animations (games, real-time dashboards) | High |
| Server Sent Events | One-way data updates (moving a ball based on server math). | Medium |
| Static Files | Serving animated .mp4 or .gif files stored on the server. | Very Low |
An event occurs: A button is clicked or a timer goes off.
Request sent: JavaScript creates an object to talk to the server.
Server processes: The server fetches data (like from a database).
Response received: The server sends data back to the browser.
Page updated: JavaScript updates the specific part of the page with the new data.
| State | Name | Description |
|---|---|---|
| 0 | UNSENT | Client has been created. open() not called yet. |
| 1 | OPENED | open() has been called. |
| 2 | HEADERS_RECEIVED | send() has been called, and headers are available. |
| 3 | LOADING | Downloading; responseText holds partial data. |
| 4 DONE | The operation is complete. Time to use the data! |
IT315 MOBILE APPLICATION DEVELOPMENT