NEW
Font size
Worksheetshtml css and javascript
Total questions: 50
Worksheet time: 26mins
Which tag indicates the presence of javascript
<css>
<script type="text/javascript">
<?php>
<style>
javascript can be written within
<head> tag only
<body> tag only
it can be written within both <head> and <body> tag
none of the above
When the javascript code is written inside html it will be saved as
.html
.css
.js
none of the above
in javascript what command is equivalent to print statement of c program
alert
write
echo
<html>
<head>
<script>
function add(){
var a=10;
var b=20;
document.write("sum is "+c);
</script></head>
<body>
<button onclick="add()">add 2 numbers</button>
</body>
</html>
30
40
error
none of the above
WHAT IS THE OUTPUT
<html>
<head>
<script>
function add(){
document.getElementById("one").innerhtml="AFTER CHANGE";
</script></head>
<body>
<p id="one">BEFORE CHANGE</p>
<button onclick="add()">change</button>
</body>
</html>
PARAGRAPH CONTENT CHANGED TO AFTER CHANGE
PARAGRAPH CONTENT REMAINS SAME
ERROR
ONLY BUTTON WILL APPEAR
Javascript is
client side scripting language
server side scripting language
both client and server side scripting language
none of the above
Which of the following is correct
document.getElementByID(" ")
document.getElementByName(" ")
document.getElementByClass(" ")
all of the above
Which are the main features of XML?
Text data description
Human- and computer-friendly format
Handles data in a tree structure having one-and only one-root element
All mentioned above
Is this a 'well formed' XML document?
< ?xml version="1.0"? >
< note >
< to age="29" >John< /to >
< from >Smiley< / from >
< / note >
True
False
To use the external DTD we have the syntax
<?xml version=”A.0” standalone=”no”?>
<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>
<?xml version=”A.0” standalone=”yes”?>
<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>
<?xml version=”A.0” standalone=”no”?>
<! DOCTYPE DOCUMENT “order.dtd”?>
<?xml version=”A.0” standalone=”yes”?>
<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>
What is the correct syntax for referring to an external script called " abc.js"?
<script href=" abc.js">
<script name=" abc.js">
<script src=" abc.js">
None of the above
<script type="text/javascript">
x=4+"4";
document.write(x);
</script>
Output------?
44
8
4
Error output
Which one is the correct order of phases in JSP life cycle?
Initialization, Cleanup, Compilation, Execution
Initialization, Compilation, Cleanup, Execution
Compilation, Initialization, Execution, Cleanup
Cleanup, Compilation, Initialization, Execution
Which of the following action variable is used to include a file in JSP?
jsp:setProperty
jsp:getProperty
jsp:include
jsp:plugin
“out” is implicit object of which class?
javax.servlet.jsp.PrintWriter
javax.servlet.jsp.SessionWriter
javax.servlet.jsp.SessionPrinter
javax.servlet.jsp.JspWriter
In JSP Action tags which tags are used for bean development?
jsp:useBean
jsp:setPoperty
jsp:getProperty
All mentioned above
Which technology do we mix our business logic with the presentation logic?
Servlet
JSP
Both A & B
None of the above
In JSP page directive which attribute defines the MIME(Multipurpose Internet Mail Extension) type of the HTTP response?
import
contentType
extends
info
Which syntax is used to comment in JSP?
<!-- Comment -->
<@-- Comment -->
<%-- Comment -->
<&-- Comment -->
Which implicit object of JSP is equivalent to this variable of Java programming language?
page
pageContext
config
application
Choose the correct syntax of include directive?
<%@ include page="file.jsp" %>
<% include file="file.jsp" %>
<%@ include file="file.jsp" %>
<%! include page="file.jsp" %>
Which method is called only once in Servlet life cycle ?
service()
initialize()
init()
all of the above
Which method defined in the HttpServletRequest returns the object of RequestDispatcher ?
getRequestDispatcher()
getDispatcher()
getRequest()
requestDispatcher()
If the client has disabled cookie in the browser, which session management mechanism could the web container employ ?
Session Management using Cookies
Session Management using URL rewriting
Either Cookies or URL rewriting
Cookies and URL rewriting must be used together
Cookies are stored on _______ side.
Client
Server
database
none
Which method is used to delete a session?
invalidateSession()
invalidate()
deleteSession()
delete()
Which method is used access the cookies that are added to response object?
getCookies()
getNewCookies();
cookies();
returnCookies();
Inside which HTML element do we put the JavaScript?
<js>
<script>
<scripting>
<javascript>
Which of the following is the correct Javascript format for a comment?
// "the text"
/"the text"/
*/"the text"/*
\\"the text
Which message will the user see? / Quel message l'utilisateur verra-t-il?
"Hello user"
No message
"Goodbye user"
"message + user"
How can a developer show a pop-up message to the user?
alert
prompt
console.log
<p> tag
What is the correct syntax for referring to an external JavaScript script?
<script src="myscript.js"></script>
<script href="myscript.js"></script>
<js href="myscript.js"></js>
<js src="myscript.js"></js>
What attribute/value do we use to make a button execute JavaScript when clicked?
onclick="doSomething;"
on-click="doSomething;"
onclick="doSomething();"
onclick=doSomething();
Which option is true about session scope?
Objects are accessible only from the page in which they are created
Objects are accessible only from the pages which are in same session
Objects are accessible only from the pages which are processing the same request
Objects are accessible only from the pages which reside in same application
Which one of the following is correct for directive in JSP?
<%@directive%>
<%!directive%>
<%directive%>
<%=directive%>
How many jsp implicit objects are there and these objects are created by the web container that are available to all the jsp pages?
8
9
10
7
