GATE / CS ARCHIVE

GATE CSE 2015 SET 3 / QUESTION 18

GATE CSE 2015 Set 3 Q18

Engineering Mathematics & Other Topics · Web Technologies · Full GATE CSE 2015 Set 3 paper

GATE 2015 Set 3, Q18 1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Web Technologies

Question 18, GATE 2015: A server stores ten pages at http://www.yourname.com/var.html, with var=1,...,10. Page W1 (var=1) is saved locally for editing/testing, while the other pages stay on the server. W1 contains relative links of the form “var.html”. Which addition makes all relative links resolve to the server pages? Printed options (including their malformed attribute punctuation): (A) <a href: “http://www.yourname.com/”, href: “...var.html”>; (B) <base href: “http://www.yourname.com/”>; (C) <a href: “http://www.yourname.com/”>; (D) <base href: “http://www.yourname.com/”, range: “...var.html”>. Distinguish the intended element from valid HTML syntax.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Our answer: B conceptually, after fixing HTML attribute syntax

1. A base element sets the base URL used to resolve relative links, so the intended B is <base href="http://www.yourname.com/">.

2. Anchor elements only make individual links. The printed options use href: rather than href=; literal B therefore is not the required valid HTML attribute assignment. Retain the official conceptual answer with the syntax correction explicit.

Original paper, page 59 · Answer key