VIVA QUESTIONS
1) What is JavaScript?
● JavaScript was designed to add interactivity to HTML pages
● JavaScript is a scripting language
● A JavaScript consists of lines of executable computer code
● A JavaScript is usually embedded directly into HTML pages
● JavaScript is an interpreted language (means that scripts execute without preliminary compilation)
● Everyone can use JavaScript without purchasing a license
● JavaScript's official name is "ECMAScript".
2) What can a JavaScript Do?
● JavaScript gives HTML designers a programming tool
● JavaScript can put dynamic text into an HTML page ,JavaScript can react to events ,JavaScript can read and
write HTML elements
● JavaScript can be used to validate data - A JavaScript can be used to validate form data before it is
submitted to a server. This saves the server from extra processing
● JavaScript can be used to detect the visitor's browser - A JavaScript can be used to detect the visitor's
browser, and - depending on the browser - load another page specifically designed for that browser
● JavaScript can be used to create cookies - A JavaScript can be used to store and retrieve information on
the visitor's computer
3) How is a JavaScript Executed?
● JavaScripts in a page will be executed immediately while the page loads into the browser,
Sometimes we want to execute a script when a page loads, other times when a user triggers an
event.
● Scripts in the head section: Scripts to be executed when they are called, or when an event is triggered, go
in the head section. When the script is in head section, we mustl ensure that the script is loaded before
anyone uses it
4) INTERFACING JavaScript
● JavaScript and the HTML DOM
With HTML 4, JavaScript can also be used to change the inner content and attributes of HTML
elements dynamically. To change the content of an HTML element use:
document.getElementById(id).innerHTML=new HTML
To change the attribute of an HTML element use:
document.getElementById(id).attribute=new value
● web manual ver05.docJavaScript and HTML Events
Page | 1
New to HTML 4 is the ability to let HTML events trigger actions in the browser, like starting a
JavaScript when a user clicks on an HTML element.
To execute code when a user clicks on an element, use the following event attribute:
onclick=JavaScript
You will learn more about JavaScript and HTML Events in a later chapter.
● JavaScript and CSS
With HTML 4, JavaScript can also be used to change the style of HTML elements.
To change the style of an HTML element use:
document.getElementById(id).style.property=new style
5) What is a Event handler
An event handler allows you to execute code when an event occurs.Events is generated by the browser
when the user clicks an element, when the page loads, when a form is submitted, etc.
6) What is DHTML
DHTML stands for Dynamic HTML.Dynamic HTML, a combination of HTML enhancements, scripting
language and interface that are used to deliver animations, interactions and dynamic updating on web
pages. DHTML is the merging of HTML and JavaScript.
7) What is the DOM?
● With JavaScript we can restructure an entire HTML document. You can add, remove, change, or
reorder items on a page.To change anything on a page, JavaScript needs access to all elements in
the HTML document. This access, along with methods and properties to add, move, change, or
remove HTML elements, is given through the Document Object Model (DOM).
● In 1998, W3C published the Level 1 DOM specification. This specification allowed access to and
manipulation of every single element in an HTML page.
● All browsers have implemented this recommendation, and therefore, incompatibility problems in
the DOM have almost disappeared.
● The DOM can be used by JavaScript to read and change HTML, XHTML, and XML documents.
● The DOM is separated into different parts (Core, XML, and HTML) and different levels (DOM
Level 1/2/3):
1)Core DOM - defines a standard set of objects for any structured document
2)XML DOM - defines a standard set of objects for XML documents
3)HTML DOM - defines a standard set of objects for HTML documents
Page | 2
8) What Is XHTML
● XHTML stands for EXtensible HyperText Markup Language
● XHTML is almost identical to HTML 4.01
● XHTML is a stricter and cleaner version of HTML
● XHTML is HTML defined as an XML application
● XHTML is a W3C Recommendation
9) What is XML
● XML stands for EXtensible Markup Language
● XML is a markup language much like HTML
● XML was designed to carry data, not to display data
● XML tags are not predefined. we must define our own tags
● XML is designed to be self-descriptive
● XML is a W3C Recommendation
10) Difference between XML and HTML
● XML is not a replacement for HTML.
XML and HTML were designed with different goals
● XML was designed to transport and store data, with focus on what data is.
HTML was designed to display data, with focus on how data looks.
● HTML is about displaying information, while XML is about carrying information.
11) What is XSLT
● XSLT stands for XSL Transformations
● XSLT is the most important part of XSL
● XSLT transforms an XML document into another XML document
● XSLT uses XPath to navigate in XML documents
12) What is Perl?
● PERL- Practical Extraction and Report Language.
● Perl is a high-level programming language written by Larry Wall. It derives from the ubiquitous C
programming language and to a lesser extent from sed, awk, the Unix shell, and at many other tools and
languages. Perl's process, file, and text manipulation facilities make it particularly well-suited for tasks
involving quick prototyping, system utilities. software tools, system management tasks, database access,
graphical programming, networking, and world wide web programming.
● Perl is a powerful free interpreter. Perl is portable, flexible and easy to learn
13) What is CSS
● CSS stands for Cascading Style Sheets
● Styles define how to display HTML elements
● Styles were added to HTML 4.0 to solve a problem
● External Style Sheets can save a lot of work
● External Style Sheets are stored in CSS files
Page | 3
14) What is HTML
HTML is a language for describing web pages.
● HTML stands for Hyper Text Markup Language
● HTML is not a programming language, it is a markup language
● A markup language is a set of markup tags
● HTML uses markup tags to describe web pages
HTML markup tags are usually called HTML tags
● HTML tags are keywords surrounded by angle brackets like <html>
● HTML tags normally come in pairs like <b> and </b>
● The first tag in a pair is the start tag, the second tag is the end tag
● Start and end tags are also called opening tags and closing tags
15)What is PHP
● PHP stands for PHP: Hypertext Preprocessor
● PHP is a server-side scripting language, like ASP
● PHP scripts are executed on the server
● PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.)
● PHP is an open source software
● PHP is free to download and use
16) What is a PHP File
● PHP files can contain text, HTML tags and scripts
● PHP files are returned to the browser as plain HTML
● PHP files have a file extension of ".php", ".php3", or ".phtml"
17)What is MySQL
● MySQL is a database server
● MySQL is ideal for both small and large applications
● MySQL supports standard SQL
● MySQL compiles on a number of platforms
● MySQL is free to download and use
18) Why PHP
● PHP runs on different platforms (Windows, Linux, Unix, etc.)
● PHP is compatible with almost all servers used today (Apache, IIS, etc.)
● PHP is FREE to download from the official PHP resource: www.php.net
● PHP is easy to learn and runs efficiently on the server side
● To get access to a web server with PHP support, Install Apache (or IIS) on your own server, install PHP, and
MySQL
19) What is SQL
● SQL stands for Structured Query Language
Page | 4
● SQL lets you access and manipulate databases
● SQL is an ANSI (American National Standards Institute) standard
20) What Can SQL do
● SQL can execute queries against a database
● SQL can retrieve data from a database
● SQL can insert records in a database
● SQL can update records in a database
● SQL can delete records from a database
● SQL can create new databases
● SQL can create new tables in a database
● SQL can create stored procedures in a database
● SQL can create views in a database
● SQL can set permissions on tables, procedures, and views
21) ABOUT RDBMS
● RDBMS stands for Relational Database Management System.
● RDBMS is the basis for SQL, and for all modern database systems like MS SQL Server, IBM
DB2, Oracle, MySQL, and Microsoft Access.
● The data in RDBMS is stored in database objects called tables.
● A table is a collection of related data entries and it consists of columns and rows.
22) What is a Cookie
A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's
computer. Each time the same computer requests a page with a browser, it will send the cookie too. With
PHP, you can both create and retrieve cookie values.
23) How to Create a Cookie
The setcookie() function is used to set a cookie.Syntax
setcookie(name, value, expire, path, domain);
24)About PHP session
● A PHP session variable is used to store information about, or change settings for a user session. Session
variables hold information about one single user, and are available to all pages in one application.
● When working with an application, you open it, do some changes and then you close it. This is
much like a Session. The computer knows who you are. It knows when you start the application
and when you end. But on the internet there is one problem: the web server does not know who
you are and what you do because the HTTP address doesn't maintain state.
● A PHP session solves this problem by allowing you to store user information on the server for
later use (i.e. username, shopping items, etc). However, session information is temporary and will
Page | 5
be deleted after the user has left the website. If you need a permanent storage you may want to
store the data in a database.
● Sessions work by creating a unique id (UID) for each visitor and store variables based on this
UID. The UID is either stored in a cookie or is propagated in the URL.
25) Starting a PHP Session
Before you can store user information in your PHP session, you must first start up the session.
Using the session_start() function .
26) Storing a Session Variable
The correct way to store and retrieve session variables is to use the PHP $_SESSION variable
27) Destroying a Session
If you wish to delete some session data, you can use the unset() or the session_destroy() function.The
unset() function is used to free the specified session variable
28) What is CGI Scripting
CGI stands for Common Gateway Interface, which is the standard for creating dynamic files or web
pages. CGI scripting actually refers to writing a program that will control how a website's content can be
displayed to visitors.
29) What is a Web Browser
A web browser is a software application that enables users to access the World Wide Web (WWW). To
do this, a web browser must provide these capabilities:
● A web browser must be able to understand data protocols utilized by web servers, such as HTML and
XHTML.
● A web browser must be able to format (or render) the output of these languages
● Some popular web browsers-Microsoft Internet Explorer , Netscape Navigator ,Opera , Mozilla
30) What is World Wide Web
The World Wide Web is a system of interlinked hypertext documents contained on the Internet. With a web
browser, one can view web pages that may contain text, images, videos, and other multimedia and navigate
between them using hyperlinks.
31) What is World Wide Web Consortium (W3C)?
The World Wide Web Consortium (W3C) is an international community that develops standardsto ensure the
long-term growth of the Web.
Page | 6
32) Difference between Echo and print
● Echo works faster than print().
● Echo and print are language construct.
● Print behaves as a function and it returns an integer value.
● Echo does not return any values.
● Echo is not suitable for conditional construct
● Print is suitable for conditional construct
● Print process is slower than echo.
33) What is a Web Server?
● Provides access to the web resources
● Server-side software responsible for handling incoming HTTP requests
● Computer running application software that listens and responds to a client computer’s request made
through a web browser
● Machine that hosts web pages and other web documents
● Most commonly used Web Servers are: Apache, IIS
● More than 400 million web hosts in operation, more than 60% of which were Apache, around 30% were
IIS
● Some popular Web Servers
Apache , IServer , Microsoft Internet Information Server ,Macromedia ColdFusion ,IBM Web Sphere
Studio, Apple Webobject
34) What is a Web page
● Set of data consists of one or several web resources, that can be identified by an URI(Universal/Uniform
Resource Identifier)
● Electronic document that typically contains several types of information accessible via the World Wide
Web
● set of information created, and organized, using HTML and/or other web page authoring and
development tools
● Interpreted and displayed on the screen according to the instructions of the web page authoring tool
Page | 7
35) What is a Web Site
A collection of related web pages of a certain individual, group, or organization, connected through a system of
hyperlinks, hosted in a particular domain
can be a single web page that contains links to related information located on several web sites
36) What is a home page?
The main page of a web site that typically serves as an index or table of contents to other web pages
usually the first web page or the welcome page the users see when they visit a web site
XML
Is a simplified subset of SGML. It stands for eXtensible Markup Language.
DTD
Stands for Document Type Declaration. It is a set of instructions that states what tags are usable and what
(re)action they create. Each browser has a DTD set in it's programming set by the browser companies. This is how
some tags will work in only one type of browser or version. It has the tags stated in it's DTD. XML makes it possible
to create unique tag sets by applying it's own DTD. This makes the DTD more compatible with more browsers.
XSLT
Stands for eXtensible Stylesheet Language Transformation. It is a strong version of CSS that formats the XML page
for viewing.
MIME type
A Multipurpose Internet Mail Extension (MIME) type identifies the format of a file. The MIME type enables
applications to read the file.
Uniform Resource Identifier
A Uniform Resource Identifier (URI) is a string that identifies a particular location in a file system or on the Web.
For example, the address of a web page is a URI.
Uniform Resource Locator
A Uniform Resource Locator (URL) is the address of a particular location on the Web.
Internet
Page | 8
a physical network connecting millions of computers using the protocols for sharing/transmitting information
(TCP/IP)
In reality, the Internet is a network of networks
Basically, just a computer network spanning most of the world
Server-side programming
Server-side scripts or programs are simply programs that are run on the web server in response to requests from
the client
Technologies such as CGI, Active Server Pages, Java Servlets and PHP run on Server
Best, if the program needs a lot of data and infrequent interactions with the server.
Client-side web programming
Client-side scripts or programs are simply programs that are run on the web browser, downloaded
from server
Technologies such as JavaScript, VBScript and Java applets all run in the client
Best, if applications that use less data and more interaction
Page | 9