File Management

How to Build Websites

To use JavaScript an understanding of building websites is required, and to build a website it all starts with understanding file paths.In this lesson filepaths, folders, files, relative path, and absolute path will be defined.

Absolute Filepath

Absolute filepaths are the complete filepath of a file on your machine. If you are using a good machine, absolute filepaths always start with C:/. Absolute paths work when building a site locally such as using Live Server in VS Code. However it is IMPORTANT TO NOTE ABSOLUTE PATHS DO NOT WORK ONCE THE SITE IS LIVE. example of absolute file path: C:\Users\Zachary\Desktop\MU-TH-ER_cpp_programs

Relative Filepath

Relative filepaths are only a portion of an absolute filepath. RELATIVE FILEPATHS MUST BE USED WHEN SITE IS HOSTED ON A SERVER SUCH AS GITHUB PAGES. These paths start at the location you are currently in. Such as file-management\index.html (this is the Relative path of this page.)

Moving Up a File path with ../

If you need to access a file one path up from your current location ../ is the prefix that is added to the path. Example ../images/jsCartographer4_32.png" this is how this index.html accesses the favicon in the root.