Skip to main content

Fundamentals of Front End Development MCQs with Answers

Practice important Fundamentals of Front End Development MCQs with answers and explanations.

Chapter: 146
Q1641:
How can you append received data to an element in the HTML document using SSE?
A. res.innerHTML += event.data + "
B. res.innerHTML = event.data;
C. res.appendChild(event.data);
D. res.textContent += event.data;
Correct Answer: A
Chapter: 146
Q1642:
Fill in the blank: The server-side event stream syntax requires starting with the header "Content-Type: ______".
A. text/event-stream
B. application/json
C. text/html
D. application/x-www-form-urlencoded
Correct Answer: A
Chapter: 146
Q1643:
What is a key feature of Server-Sent Events compared to older methods of receiving server updates?
A. The updates are sent automatically
B. The updates require a user prompt
C. The updates are sent less frequently
D. The updates are encrypted
Correct Answer: A
Chapter: 146
Q1644:
Which JavaScript event is triggered when a message is received from the EventSource?
A. onmessage
B. onload
C. onerror
D. onchange
Correct Answer: A
Chapter: 146
Q1645:
Fill in the blank: Server-Sent Events only work if the browser supports the ______ object.
A. EventSource
B. XMLHttpRequest
C. Fetch
D. WebSocket
Correct Answer: A
Chapter: 147
Q1646:
What header should be set to enable Server-Sent Events in PHP?
A. Content-Type: application/json
B. Content-Type: text/html
C. Content-Type: text/event-stream
D. Content-Type: application/xml
Correct Answer: C
Chapter: 147
Q1647:
Fill in the blank: In the PHP code, the header('Cache-Control: ______') ensures that the page is not cached.
A. no-cache
B. private
C. public
D. max-age=0
Correct Answer: A
Chapter: 147
Q1648:
What is the correct format for sending data in a Server-Sent Event?
A. data: Your data here
B. content: Your data here
C. message: Your data here
D. info: Your data here
Correct Answer: A
Chapter: 147
Q1649:
Which event occurs when a connection to the server is successfully opened using EventSource?
A. onopen
B. onmessage
C. onerror
D. onload
Correct Answer: A
Chapter: 147
Q1650:
What is the default behavior for caching in Server-Sent Events?
A. Caching is enabled
B. Caching is disabled
C. Caching is optional
D. Caching is automatic
Correct Answer: B
Chapter: 147
Q1651:
Fill in the blank: The onmessage event of the EventSource object is triggered when a ______ is received from the server.
A. message
B. connection
C. error
D. request
Correct Answer: A
Chapter: 147
Q1652:
In the provided PHP code, what does date('r') return?
A. The current server time
B. The current server date
C. The server's time zone
D. The server's date and time format
Correct Answer: A
Chapter: 147
Q1653:
Which function in PHP ensures that the output buffer is sent to the browser immediately?
A. flush()
B. ob_end_flush()
C. echo()
D. print()
Correct Answer: A
Chapter: 147
Q1654:
Fill in the blank: In the EventSource object, the onerror event is triggered when an ______ occurs.
A. error
B. open
C. message
D. close
Correct Answer: A
Chapter: 147
Q1655:
What should follow the data: prefix in the Server-Sent Events format?
A. The data to be sent
B. The header information
C. The status code
D. The event type
Correct Answer: A
Chapter: 147
Q1656:
Fill in the blank: The header('Cache-Control: no-cache') directive in PHP is used to prevent the browser from ______ the server-sent events.
A. caching
B. updating
C. storing
D. processing
Correct Answer: A
Chapter: 148
Q1657:
What is CSS3 divided into?
A. Files
B. Modules
C. Classes
D. Libraries
Correct Answer: B
Chapter: 148
Q1658:
Which CSS3 module is responsible for adding new selectors?
A. Selectors
B. Box Model
C. Backgrounds and Borders
D. Text Effects
Correct Answer: A
Chapter: 148
Q1659:
Fill in the blank: The CSS3 module that deals with layout features like columns is called ______.
A. Multiple Column Layout
B. Box Model
C. Animations
D. Image Values and Replaced Content
Correct Answer: A
Chapter: 148
Q1660:
Which of the following is NOT a CSS3 module?
A. Box Model
B. User Interface
C. Selectors
D. Grid Layout
Correct Answer: D

Test Your Knowledge

Take a timed quiz on Fundamentals of Front End Development

🚀 Start Quiz Now