In the ES2015 Import Tag What is an Absolute Reference

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import says that you can use absolute filenames for references, and all of the examples on the page start with / and therefore look like absolute filenames. But absolute relative to what? The browser does not have access to the file system that is running the web server, so it cannot use actual file names. Relative file names are ugly and depend upon exactly where the current file was loaded from. Can I assume that “absolute” file references are qualified by the web domain? So “import … from ‘/folder/filename.js’” retrieves https://www.domain/folder/filename.js?

Hello @jamescobban

that’s correct but the absolute and relative path are the path tht wriiten in the webpage/site

absolute mean the path starting from the root of partition like c:\data\site and so on and ofcourse in linux/unix it would be / “which is the root”

relative mean it start from the current location of the site/page so if it inside it it would be /internalfolder/insideinternalfolder

when you give full/absoulte path it be a location to the resource on the hard disk or the full url if it in external site

of course you can use links for internal resource but it would do extra usuelss job like getting the address from the dns then check the path of page then search for it’s resouce even it take little time in todays world but the more use of this would affect the performance of your site

hope that help and have a nice day :slight_smile: