Web Technology Lab (BCSLS04)
VIVA QUESTIONS
‘What is web technology?
A: Web technology encompasses the tools and techniques used to communicate
between different devices over the internet, including protocols, languages (HTML,
CSS, JavaScript), frameworks, and server-s
side technologies.
. What is the difference between a website and a web application?
A: A website is a collection of static or dynamic pages accessible via the internet,
typically for information display, A web application, however, is an interactive
program that enables user actions and processing, often featuring complex
interactions and data handling (¢.g., online banking, social media),
. What are front-end and back-end technologies?
A: Front-end technologies manage the user interface and experience, using HTML,
CSS, and JavaScript. Back-end technologies handle server-side operations, databases,
and business logic, typically using languages like PHP, Python, Node,js, and
databases like MySQL or MongoDB
‘What is the role of HTML in web development?
A: HTML is a markup language that structures the content on a web page, defining
elements like headings, paragraphs, images, links, tables, and forms,
‘What are semantic HTML tags?
A: Semantic HTML tags, like
, , , and , provide
meaning to the content, enhancing accessibility and SEO by indicating the role of
each section of content.
‘What is the purpose of the tag in HTML?
A: The tag provides metadata about the HTML document, such as character
encoding, author information, and viewport settings, and can improve SEO and page
behavior.
‘What is CSS used for in web development?
A: CSS is used to style and layout HTML elements, controlling design aspects like
colors, fonts, spacing, and layout to create visually appealing and responsive web
pages.
What are CSS selectors?
A: CSS selectors are patterns used to select and style specific elements on a web page.
Examples include class selectors (,className), ID selectors (#idName), and tag
selectors (elementName).
How do you make a website responsive using CSS?
A: A responsive website adapts to different screen sizes using CSS techniques like
media queries, flexible grids, and responsive units (e.g., %, vw, vh), making content
accessible on mobile, tablet, and desktop devices.
What is JavaScript, and why is it important?
A; JavaScript is a client-side scripting language that adds interactivity, dynamic
content, and logic to web pages. It enables features like animations, form validation,
data fetching, and user interaction,We Technology Lab (BCSL504)
a
a
20.
2
2
8
What is DOM manipulation in JavaScript?
A: DOM (Document Object Model) manipulation involves changing the structure,
style, or content of a webpage dynamically using JavaScript methods like
getElementByld, querySelector, and appendChild.
.. What is an event in JavaScript?
A: An event is an action or occurrence detected by JavaScript, such as a click, hover,
or form submission, JavaScript can use events to trigger specific functions, making
web pages interactive.
|. What is AJAX?
A: AJAX (Asynchronous JavaScript and XML) is a technique for updating parts of a
web page without reloading the entire page. It uses JavaScript to send and retrieve
data asynchronously from a server.
What is JSON, and why is it used?
A: JSON (JavaScript Object Notation) is a lightweight data format used for data
exchange between client and server. It is easy to read and parse in JavaScript, making
it ideal for web applications.
|. How does AJAX improve user experience on a website?
A: AJAX allows for seamless data loading and updates without page refreshes,
providing a smoother and faster user experience by only reloading the necessary parts
of'a page.
What is jQuery?
A: jQuery is a JavaScript library that simplifies tasks like DOM manipulation, event
handling, animation, and AJAX. It allows developers to write less code to achieve
common JavaScript tasks.
How do you select an element in jQuery?
‘A: Elements in jQuery are selected using the $() function, similar to CSS selectors.
For example, $("#id") selects an element by ID, and $(".class") selects elements by
class.
What is the purpose of the .animate() method in jQuery?
‘A: The .animate() method in jQuery enables custom animations by allowing
developers to specify CSS properties and animate their changes over time.
What is PHP used for in web development?
A: PHP is a server-side scripting language commonly used for building dynamic
websites, handling form data, managing databases, and generating HTML content on
the server.
How do you connect to a database in PHP?
A: You can connect to a database in PHP using mysqli_connect() or PDO (PHP Data
Objects) to establish a connection, execute queries, and fetch data.
What is the difference between echo and print in PHP?
A: Both echo and print are used to output data in PHP, but echo is slightly faster and
allows multiple arguments, while print only accepts one argument and returns a value.
What is HTTP?
A: HTTP (Hypertext Transfer Protocol) is the foundational protocol for data
communication on the web, defining how messages are formatted and transmitted,Web Technology Lab (BCSL504
23.
24,
3,
26.
27.
28.
29.
30.
31.
$2)
33.
34.
35.
What is HTTPS, and why is it important?
A: HTTPS (Hypertext Transfer Protocol Secure) is an encrypted version of HTTP that
provides a secure connection for transmitting sensitive data, protecting users’ privacy
and security.
What are cookies in web development?
A: Cookies are small pieces of data stored on the client’s browser that allow websites
to remember user information, like login credentials or user preferences, across
sessions.
What is a Web API?
A: A Web API (Application Programming Interface) allows different software
applications to communicate with each other over the internet, enabling web
applications to access data or services from other systems.
What is the Fetch API in JavaScript?
A: The Fetch API provides a modern way to make asynchronous HTTP requests in
JavaScript, replacing the older XMLHttpRequest method. It is widely used for
making AJAX requests to retrieve or send data.
What is REST in web development?
A: REST (Representational State Transfer) is an architectural style for designing
networked applications, often used to create APIs that perform CRUD (Create, Read,
Update, Delete) operations over HTTP.
Why is responsive design important in web development?
‘A: Responsive design ensures that a website adapts to different screen sizes and
devices, providing an optimal user experience on mobile, tablet, and desktop devices.
What is the purpose of using an external style sheet?
A: An extemal style sheet separates CSS from HTML, making it easier to maintain,
reuse, and update styles across multiple pages.
Why is code validation important for web pages?
A: Code validation checks for errors and ensures adherence to web standards,
improving compatibility, accessibility, and SEO.
What is the purpose of the tag in HTML?
A: The tag defines the title of the webpage, which appears on the browser tab
and helps with search engine optimization.
How do you ereate scrolling text in HTML?
A: By using the tag, although it's deprecated. CSS animations are
preferred for creating moving text.
What is the difference between and taj
A: is the highest-level heading (largest), and is the lowest-level heading
(smallest) for organizing content hierarchy.
How do and tags differ?
A; applies bold styling, while indicates important text and may affect
accessibility.
What attributes are used for merging cells ina table?
A: rowspan and colspan attributes.Web Technology. Lab (BCSLS04)
36,
37.
3
39,
4
4
4
4
46.
47.
48.
49.
5
5
52.
5
Ed
Ss
is
B
=
3
How do you add color to table rows or cells?
A: Using the style attribute or CSS classes with background-color properties.
What's the purpose of , , and in a table?
A: They separate different sections of a table: for the header, for the
body, and for the footer.
What is the difference between an [ID and a class in CSS?
A: An ID is unique and used once on a page (#id), while a class can be reused across
multiple elements (.class).
How do CSS selectors work?
A: CSS selectors apply styles to elements based on attributes like tag name, class, ID,
or other attributes.
What is the purpose of an external CSS file?
A: To separate styling from HTML, making code modular, maintainable, and reusable
across multiple pages.
. How do you change the color of form elements in CSS?
y using CSS properties like background-color, color, and border-color.
What are different types of input elements in HTML?
A: Common input types include text, password, checkbox, radio, submit, email, date,
and number.
How do you align form fields using HTML and CSS?
A: Using a table or CSS properties like display: flex or grid.
What is the purpose of semantic elements like , , and ?
A: Semantic elements add meaning to the content structure, aiding in readability and
accessibility,
. How does differ from ?
A: is used to group an image and caption with , providing
context.
How do you capture input values from an HTML form in JavaScript?
A: By using document.getElementByld((*inputID").value or similar methods.
What is the purpose of Math.pow() in JavaScript?
A: It calculates the power ofa number, e.g., Math.pow(base, exponent).
How do you display the result of a calculation in HTML?
A: By using JavaScript to set the inner HTML or value of an HTML element.
How do you convert JSON text to a JavaScript object?
A: Using JSON. parse(jsonText).
What is JSON, and why is it used?
Az JSON (JavaScript Object Notation) is a lightweight data format used for
exchanging data between servers and clients.
. How can you convert JSON results toa date in JavaScript?
A: By parsing the JSON date string and using new Date(dateString)
Q:How does PHP keep track of visitor counts?
A: PHP can read from and write to a file to increment the visitor count each time the
page is loaded.
What is the purpose of file_get_contents() in PHP?Web Technology Lab (BCSL504)
54,
55.
5
B
$7.
58.
59.
60.
él.
6:
6.
‘A: It reads the content of a file into a string.
How do you display PHP data on an HTML page?
A: By embedding PHP code within HTML using .
How does PHP connect to a MySQL database?
A: By using the mysqli_connect() function or PDO.
What is the purpose of selection sort?
A: Selection sort is an algorithm to sort elements by repeatedly finding the minimum
or maximum element and placing it at the correct position.
How do you retrieve records from a database in PHP?
A: By executing an SQL query with mysqli_query() and fetching results using
mysqli_fetch_assoc().
How do you append content to an element in jQuery?
‘A: By using the .append() method.
What does the animate() method do in jQuery?
A: It performs custom animations by changing CSS properties with gradual
transitions,
How do you change the color of an animated element in jQuery?
A: By using .css() after the animation completes or by chaining animate).
How do you make an AJAX request in JavaScript without jQuery?
A: By using the XMLHttpRequest object,
What does the getJSON() method do in jQuery?
Az It makes an AJAX request and automatically parses the SON response.
. How do you parse JSON in JavaScript?
A: By using JSON, parse(jsonString) to convert JSON text to a JavaScript object.
Te E EO SOHO ESS EO ODE OSSD ET OC EOC OEOOE EOS ODE IIE HE