Understanding Paths in Terminals and Websites

  Рет қаралды 1,337

Steve Griffith - Prof3ssorSt3v3

Steve Griffith - Prof3ssorSt3v3

Күн бұрын

Пікірлер: 10
@shahinza
@shahinza Жыл бұрын
Thanks
@amircahyadi9219
@amircahyadi9219 Жыл бұрын
Thanxs sir ❤👍👍
@mkm_
@mkm_ Жыл бұрын
So when loading images (or other files) inside the html, is there a convention on when to use "img/puppy.webp" or "./img/puppy.webp"? Because I'm never sure which one is more _appropriate._
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 Жыл бұрын
Both are absolutely fine.
@aleksandr2245
@aleksandr2245 Жыл бұрын
In my humble opinion, it is better to use absolute paths in HTML. This way, when you deploy your frontend app or return static files using Express, users cannot break everything by specifying incorrect paths and hitting reload. For example, if a user tries to access domain/bla-bla/nothing-here, all our assets, styles, and images will still be bound to the root.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 Жыл бұрын
@Aleksandr it will depend on the location of the asset. For external ones you have to use absolute. With relative paths your code can run in your dev, staging, and production environments without changing the paths even when the folder location relative to the root changes between environments
@aleksandr2245
@aleksandr2245 Жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 Thank you for clarifying!
@Mahmoud_A999
@Mahmoud_A999 Жыл бұрын
I didn't understand the /img is it referring to the root of the file or the system? I have misunderstanding to this point
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 Жыл бұрын
Web Servers have a root folder that they point to. They can access anything inside that folder but not outside of it. "/" points to that root folder.
@Mahmoud_A999
@Mahmoud_A999 Жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 ok thanks
Important differences between textContent and innerText
11:44
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 2,5 М.
Chrome Dev Tools Data and File Storage
14:17
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 2,9 М.
Trick-or-Treating in a Rush. Part 2
00:37
Daniel LaBelle
Рет қаралды 43 МЛН
Elza love to eat chiken🍗⚡ #dog #pets
00:17
ElzaDog
Рет қаралды 25 МЛН
Mia Boyka х Карен Акопян | ЧТО БЫЛО ДАЛЬШЕ?
1:21:14
Что было дальше?
Рет қаралды 12 МЛН
When mom gets home, but you're in rollerblades.
00:40
Daniel LaBelle
Рет қаралды 143 МЛН
Enhanced UI control and Responsible Accessibility with the HTML INERT Property
12:02
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 1,8 М.
Learn CSS Animations In 20 Minutes - For Beginners
21:22
Slaying The Dragon
Рет қаралды 1,1 МЛН
Heroku Is Dead, Here's What I Recommend
11:59
Theo - t3․gg
Рет қаралды 265 М.
Revealing the Differences between HTML Dialogs and the Popover API
24:14
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 9 М.
Chrome Dev Tools Console Super Powers
16:44
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 8 М.
Web Hosting with Github and Vercel
33:42
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 1,2 М.
Chrome Dev Tools Source Panel and Breakpoints
18:21
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 7 М.
Trick-or-Treating in a Rush. Part 2
00:37
Daniel LaBelle
Рет қаралды 43 МЛН