Computer Knowledge
Markup and Web Languages
1,701 Questions
Test your understanding of HTML tags, XML structures, and web page creation technologies. The questions cover elements like CSS styling, parsing documents, and defining web attributes. This section is essential for candidates appearing for computer proficiency tests in various competitive exams.
HTML tags and attributesXML document parsingCSS styling levelsWeb page creation basicsBrowser compatibility
Markup and Web Languages Questions
-
@exception
-
@throwing
-
@threw
-
@except
A
Correct answer
Explanation
The @exception tag is a complete synonym for @throws in Javadoc. Both tags serve the identical purpose of documenting exceptions that a method may throw, and Javadoc treats them identically. The @throws tag is more commonly used in modern practice.
-
@since
-
@dontUse
-
@deprecated
-
@thows
C
Correct answer
Explanation
The @deprecated tag is used to mark APIs as obsolete and indicates they should no longer be used. When an API is deprecated, the tag typically includes a comment recommending the replacement API or method that developers should use instead.
A
Correct answer
Explanation
JSP allows embedding Java code directly within HTML pages using special tags. While you can technically rename an HTML file to .jsp, the statement describes the basic concept that JSP combines Java logic with HTML presentation. However, the file would need actual Java code in JSP tags to be meaningful.
-
Yes, but the only tags available relate to database access.
-
No. To iterate over a collection of values, one must use scriptlet code.
-
No, but there is a standard <iterate> tag that may be used.
-
Yes, but custom tags will not help developers create tags for use in iterating over a collection.
B
Correct answer
Explanation
Custom tags were introduced in JSP 1.1, not JSP 1.0. To iterate over collections in JSP 1.0, developers had to write scriptlet code (<% %> loops) directly in the JSP page. There was no standard tag in JSP 1.0, and custom tags did not exist at all in that version.
A
Correct answer
Explanation
A JSP tag library is exactly that - a collection of custom tags encapsulating reusable functionality. Tag libraries allow developers to define custom actions that can be used in JSP pages, promoting code reuse and separating presentation from business logic. This is a fundamental concept in JSP tag extension mechanisms.
-
sp_xml_postdocument
-
sp_xml_readdocument
-
sp_xml_loaddocument
-
sp_xml_preparedocument
D
Correct answer
Explanation
sp_xml_preparedocument is the correct system stored procedure that parses an XML document and returns a handle that can be used with OPENXML. The other options are่ๆ็ names that don't exist in SQL Server. After use, the document handle should be freed with sp_xml_removedocument to avoid memory leaks.
-
<script>
-
<scripting>
-
<js>
-
<javascript>
A
Correct answer
Explanation
JavaScript code must be placed inside the element in HTML. This is the standard HTML tag defined for embedding or referencing JavaScript code. Tags like <scripting>, <js>, or <javascript> are not valid HTML elements.
-
response.write("Hello World")
-
"Hello World"
-
document.write("Hello World")
-
("Hello World")
C
Correct answer
Explanation
The correct JavaScript syntax to output text is document.write("Hello World"). The document object's write() method outputs text to the HTML document. Response.write() is ASP syntax, and just writing the string or parentheses alone are not valid JavaScript.
-
The <body> section
-
Both the <head> section and the <body> section are correct
-
The <head> section
-
None of the above
B
Correct answer
Explanation
JavaScript can be placed in either the or section. While placing scripts at the end of the body is often recommended for performance, both locations are technically valid. The section is useful for functions that should be loaded before the page content.
-
<script src="xxx.js">
-
<script name="xxx.js">
-
<script href="xxx.js">
-
<script id="xxx.js">
A
Correct answer
Explanation
The HTML `tag uses thesrc(source) attribute to link external JavaScript files like "xxx.js". Usinghrefis incorrect because it is reserved for stylesheets and links, whilenameandid` are used for identifying elements, not loading external files.
B
Correct answer
Explanation
External JavaScript files saved with .js extension should NOT contain the tag. The <script> tag is only used in HTML files to reference or embed JavaScript. Including script tags in .js files would cause syntax errors.
-
//This is a comment
-
<!--This is a comment-->
-
'This is a comment
-
/*This is a comment
A
Correct answer
Explanation
JavaScript uses // for single-line comments. Option A is correct. Option B is HTML comment syntax, option C is not valid comment syntax, and option D is incomplete (multi-line comments need both /* and */).
-
<!--This comment has more than one line-->
-
//This comment has more than one line//
-
/This comment has more than one line/
-
'This comment has more than one line
C
Correct answer
Explanation
JavaScript multi-line comments use /* to open and */ to close. Option C is correct. Option A is HTML syntax, option B is two single-line comments which won't work for multiple lines, and option D is not valid comment syntax.
-
Show Harness Rules
-
Show Peoperty Rules
-
Show Section Rules
-
Show Field Value Rules
-
Show Declarative Rules
-
Show HTML Rules
-
Rule-Obj-HTML
-
Rule-Obj-Section
-
Rule-HTML-Harness
-
Rule-HTML-SEction