1D0-61B practice question 5 of 15

Which line of code instructs the browser to look for a directory named mysite that begins one level higher than the page you are currently viewing?

Full set: 55 questions
Answer options
A: mysite/index.html
B: /mysite/index.html
C: ./mysite/index.html
D: http://www.mysite.com/index.html
Correct Answer:
NONE OF THE OPTIONS ARE CORRECT. THE CORRECT LINE OF CODE WOULD BE ../MYSITE/INDEX.HTML.
Explanation

The question requires a file path that navigates "one level higher" than the current page's directory. In URL and file path syntax, the ../ notation is the standard and only correct way to reference the parent directory. The path should therefore start with ../ to move up one level, followed by the target directory mysite/ and the filename. None of the provided options utilize this correct syntax. The options provided reference the current directory (./ or no prefix), the site's root directory (/), or an absolute URL (http://), none of which fulfill the requirement of moving one level higher.

Why Incorrect

A. mysite/index.html: This relative path points to a mysite subdirectory located inside the current directory, not one level higher.
B. /mysite/index.html: This root-relative path points to a mysite directory located at the root of the website's domain, not relative to the current page's location.
C. ./mysite/index.html: The ./ notation explicitly refers to the current directory. This path is functionally identical to option A and is incorrect.
D. http://www.mysite.com/index.html: This is an absolute URL, which provides a full and specific web address, not a relative path that navigates from the current page's location.

References

1. MDN Web Docs (Mozilla): In the article "What is a URL?", under the section "Absolute URLs vs. relative URLs," it is stated: "To link to a file in a parent directory, you use ..". This confirms that ../ is the correct syntax for moving up one level. (See: "Relative URLs" section, subsection on file paths).

2. WHATWG (Web Hypertext Application Technology Working Group): The official URL Living Standard defines path processing. In Section 4.5, "Path processing," the standard specifies that a .. segment in a path resolves to the parent directory. This is the authoritative standard for how browsers interpret URLs.

3. MIT OpenCourseWare: In the course materials for 6.171 Software Studio, Lecture 2 on Web Technologies, the concept of relative paths is explained. The notes clarify that ../ is used to refer to the parent directory, ./ to the current directory, and / to the root of the site. (Reference: MIT OCW, 6.171, Fall 2005, Lecture 2 Notes).

Scroll to Top