0% found this document useful (0 votes)
3 views80 pages

Web Technology Mcqs

The document contains multiple-choice questions (MCQs) related to web technologies, specifically focusing on JavaScript, XML, JSON, and AJAX. Each question is followed by the correct answer and a brief explanation of the concepts involved. Key topics include data types, syntax, and functionalities of various web technologies.

Uploaded by

369myview
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views80 pages

Web Technology Mcqs

The document contains multiple-choice questions (MCQs) related to web technologies, specifically focusing on JavaScript, XML, JSON, and AJAX. Each question is followed by the correct answer and a brief explanation of the concepts involved. Key topics include data types, syntax, and functionalities of various web technologies.

Uploaded by

369myview
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

WEB TECHNOLOGY

MCQS
Q. 1
• What will be the output of the following code
snippet?
• var a = true + true + true * 3;
• print(a)
A. 3
B. 0
C. Error
D. 5
• In Javascript, true is considered as the number
1 when used in any arithmetic expression,
hence the expression evaluates to 5.
Q. 2
• What will be the output of the following code snippet?
var a = 1;
var b = 0;
while (a <= 3)
{
a++;
b += a * 2;
print(b);
}
A. 4 10 18
B. 1 2 3
C. 1 4 7
D. None
• Option A
• The loop will run 3 times, before meeting the
exit condition. First value of b will be 2 * 2 = 4,
followed by 4 + 3 * 2 = 10, and then value of
10 + 4 * 2 = 18.
Q. 3
• What will be the output of the following code
snippet?

A. al
B. ale
C. cal
D. cale
• The substring function in javascript slices a
substring out of a given string from the start
to end indexes(excluding the end index). So
the 2nd and 3rd characters are taken here(0-
based indexing) and the answer is al.
Q. 4
• What will be the output of the following code
snippet?

A. 3, 4
B. 2, 3
C. 3,4,5
D. 2,3,4
• Option A
• The slice() function in Javascript slices an array
within the given start and end indexes and
then returns the values lying in those ranges.
The indexing done is 0-based indexing.
Q. 5
• When the switch statement matches the
expression with the given labels, how is the
comparison done?
A. Both data type and result of expressions are
compared
B. Only data type of the expression is compared
C. Only the value of expression is compared.
D. None
• Switch performs an ‘===’ based comparison,
i.e both the value of the expression and its
datatype is compared.
• Option A
Q. 6
• Which of the following methods can be used
to display data in some form using Javascript?
A. document.write()
B. Console.log()
C. Window.alert()
D. All of the above
• All of the above
Q. 7
• How do we write a comment in javascript?
A. /*..*/
B. //
C. #
D. $ $
• Option B
Q. 8
• Javascript is an _______ language?
A. Object oriented
B. Object based
C. Procedural
D. None of these
• Option B
Q. 9
• See the given code of JavaScript and choose the correct output from the following:
• Function comparing()
• {
• Int x=9;
• Char y=9;
• if(x==y)
• Return true;
• else
• Return false;
• }
A. compilation error
B. false
C. runtime error
D. true
• Answer: D
• Explanation: The "==" operatorconverts the
both operand to the same type in case they
both are of different datatype and perform
comparison. A strict comparison will give true
as output only when the content and the data
type of both operands are same.
Q. 10
• XML is designed to ____ and ____ data.
A. design, style
B. design, send
C. store, style
D. store, transport
• Answer: D) store, transport
Q. 11
• Which is the correct XML declaration?
a. <xml version="1.0" encoding="UTF-8"/>
b. <xml version="1.0" encoding="UTF-8"></xml>
c. <?xml version="1.0" encoding="UTF-8"?>
d. <?xml type="document" version="1.0"
encoding="UTF-8"?>
• Answer: C) <?xml version="1.0"
encoding="UTF-8"?>
Q. 12
• In an XML document, the comments are
written within ____.
a. /* and */
b. <!-- and -->
c. <# and >
d. @ and @
• Option B
Q. 13
• If element ONE is contained by element
TWO, then ONE is known as ____ of TWO.
a. ancestors
b. family
c. descendant
d. child
• Answer: C) descendant
Q. 14
• The containing element which contains other
elements is called ____ of other element.
a. ancestor
b. family
c. descendant
d. child
• Option a
Q. 15
• Which is the correct syntax to link XML file
with CSS?
a.<?xml type="text/css" href="file.css"?>
b. <?xml type="text/css" src="file.css"?>
c. <?xml-stylesheet type="text/css"
href="file.css"?>
d. <?xml-stylesheet type="text/css"
src="file.css"?>
• Option c
Q. 16
• Which options are true regarding a well-
formed XML document?
a. Each tag must have a closing tag
b. The opening and closing tag are the same i.e.,
their case must be the same
c. The child tag must be closed within the parent
tag i.e., as per the order, before closing the
parent tag.
d. All of the above
• Option d
Q. 17
• Which XML object is used to request data
from the web server?
a. XMLHttpReq
b. XMLHttpRequest
c. XMLHttpsReq
d. XMLHttpsRequest
• B) XMLHttpRequest
Q. 18
• JSON stands for _______.
a. JavaScript Object Notation
b. Java Object Notation
c. JavaScript Object Normalization
d. JavaScript Object-Oriented Notation
• Answer: A) JavaScript Object Notation
Q. 19
• The JSON syntax is a subset of the _____
syntax.
a. Ajax
b. Php
c. HTML
d. JavaScript
• Option d
Q. 20
• Which is the correct symbol to insert a
comment in JSON?
a. //
b. /*…*/
c. <!-- … -->
d. JSON doesn't support the comments
• Answer: D) JSON doesn't support the
comments
Q. 21
• In the JSON syntax, array is written within in
____.
a. Square brackets
b. Curley braces
c. Paratheses
d. None of the above
• Answer: A) Square brackets
Q. 22
• What is the correct syntax of writing JSON
name/value pair, where the value is of string
type?
a. "name" : "value"
b. "name" : value
c. "name" : 'value'
d. 'name' : 'value'
• Answer: A) "name" : "value"
Q. 23
• What is the file type for JSON files?
a. .jsn
b. .js
c. .json
d. .jso
• Option c
Q. 24
• Which is not a JSON data type?
a. number
b. string
c. array
d. date
• Option d
• Data types are
• String
• Number
• Object
• Array
• Boolean
• null
Q. 25
• Which is the correct example of a JSON object
with name, age, and city?
a. { "record":{"name":"Alex", "age":21,
"city":"London"} }
b. { "record"={"name":"Alex", "age":21,
"city":"London"} }
c. { "record":{"name":Alex, "age":21, "city":London}
}
d. { record :{"name":"Alex", "age":21,
"city":"London"} }
• Answer: A) { "record":{"name":"Alex",
"age":21, "city":"London"} }
Q. 26
• Which function is used to convert a
JavaScript object into a string?
a. JSON.string()
b. JSON.stringify()
c. JSON.ToString()
d. All of the above
• Answer: B) JSON.stringify()
Q. 27
• Ajax stands for ______.
a. Asynchronous JavaScript and XML
b. Asynchronous JSON and XML
c. Asynchronous Java and XML
d. Asynchronous JavaScript and
XMLHttpRequest
• Option A
Q. 28
• Which are the two major features of AJAX?
a. Make requests to the server without
reloading the page
b. Receive and work with data from the server
c. Make requests to the server with reloading
the page
d. Only receive the data from the server
• Option A
Q. 29
• If the value of status property is 404, what
does it mean?
a. OK
b. Forbidden
c. Method Not Allowed
d. Page not found
• Answer: D) Page not found
Q. 30
• Which among the following options is correct
regarding HTML?
a. Modelling Language
b. DTP language
c. Partial programming language
d. Used to structure web documents
• Used to structure web documents
Q. 31
• HTTPs stands for
a. Hyper Text Transfer Protocol Secure
b. High Text Transfer Protocol Secure
c. Hyper Transfer Protocol Secure
d. Hyper Transfer Protocol Standard
• Option a
Q. 32
• How can you open a link in a new browser
window?
a. < a href = “url” target = “new”>
b. <a href = “url” target= “_blank”>
c. <a href = “url”.new>
d. <a href = “url” target =”open”>
• Answer (b)
Q. 33
• Option 2
Q. 34
• Option 2
Q. 35
Q. 36
• Option 4
Q. 37
Q. 38
• Option 1
Q. 39
• Option 2
Q. 40
• In client-side hosting, which programming
language is primarily used for interactivity?
a. HTML
b. CSS
c. JavaScript
d. PHP
• Option c

You might also like