Test Series - html

Test Number 41/72

Q: URL is ___________
A. web address
B. source code
C. user’s address
D. an attribute
Solution: URL is the second name of a web address. It is composed of IP (Internet Protocol) address or words. Its full form is Uniform Resource Locators. Generally entering name while surfing is easy as numbers are hard to remember.
Q: What is the correct syntax of web address?
A. path://prefix.port:domain/filename/scheme
B. scheme://prefix.domain:port/path/filename
C. prefix://scheme.port:domain/filename/path
D. port://domain.filenmae:path/scheme/prefix
Solution: The correct syntax for a web address is scheme://prefix.domain:port/path/filename, where scheme is for https or http, prefix is for domain like www, domain denotes domain name, port defines port number, path defines path at server, filename is for name of the document.
Q: Which scheme is used for secure HyperText Transfer Protocol?
A. ftp
B. http
C. https
D. file
Solution: https scheme is for secure or encrypted web pages, http is HyperText Transfer Protocol used for common web pages which are not encrypted, ftp is file transfer protocol for downloading and uploading of documents.
Q: ASCII is _____________
A. 6-bit character set
B. 7-bit character set
C. 9-bit character set
D. 3-bit character set
Solution: ASCII consists 7-bit character set which has 128 characters. There are numbers 0-9, upper and lower case letters from A-Z, and also include special characters. Including modern computers, internet these characters are used in HTML also.
Q: In URL encoding replaces non-ASCII characters with ________
A. “*”
B. “&”
C. “%”
D. “+”
Solution: In URL encoding non-ASCII characters are replaced with “%” which is followed by hexadecimal digits. URL can only contain ASCII character set. There should be no space in the URL, space is replaced by %20 or “+” in URL encoding.
Q: Which function is used in JavaScript for URL encoding?
A. encodeURI()
B. Server.URLEncode()
C. rawurlencode()
D. UREncoding
Solution: There are some built in functions in JavaScript, ASP and PHP for URL encoding. JavaScript use encodeURI() function. ASP uses Server.URLEncode() function, rawurlencode() function is used by PHP. Space is encoded as %20 by JavaScript function.
Q: What is URL encode of ‘&’?
A. %24
B. %2c
C. %3d
D. %26
Solution: URL encoding of ‘&’ is %26, its Decimal value is 38 and the Hex value is 26. %24 is URL encode of ‘$’ whose Decimal value is 36 and Hex value is 24, %2c is URL encode of ‘,’ its Decimal value is 44 and Hex value is 2c, %3d is URL encode of ‘=’, its Decimal value is 61 and Hex value is 3d.
Q: Which of the following is not a reserved character?
A. &
B. >
C. +
D. @
Solution: Reserved characters are ‘@’, ‘=’, ‘?’, ‘:’, ‘;’, ‘/’, ‘,’, ‘+’, ‘$’, ‘&’. Unsafe characters are space, ‘”’, ‘>’, ‘<’, ‘#’, ‘%’, ‘{‘, ‘}’, ‘~’, ‘^’, ‘[‘, ‘|’, ‘’, ‘`’, ‘]’. There is a URL Encode for all of these characters. Apart from URL Encode there is Decimal and Hex value also for the characters.
Q: What is the URL Encode for tab character?
A. %09
B. %08
C. %0d
D. %0a
Solution: For tab character URL encode is %09, its Decimal value is 9 and Hex value is 09, %08 is URL encode for backspace, its Decimal value is 8 and Hex value is 08, %0d is URL Encode for carriage return, Decimal value is 13 and Hex value is 0d, %0a is URL encode for linefeed, Decimal value is 10 and Hex value is 0a.

You Have Score    /9