Make HTML load all assets and scripts

Viewed 547

I'm pretty new to web development, and we have a school project where we need to create a web shop with three different html pages and some javascript.

I implemented some jQuery as well, add a preloader and stuff. During development i used some VS code extensions like Live Server and Browser Sync.

The problem I'm having now is that i need to send my project to the professor but when i click to open my html document without hosting it on local host (so basically it opens in my browser with the path of something like C://Users/Desktop.....) it doesnt load the assets and the jQuery preloader never finished because the other pages never load.

The link to my code is: https://github.com/DzambaTz/WebShop

I think the problems is that i set some of the images as backgrounds of some divs and now they dont want to load.

Does anyone know a solution to this problem?

2 Answers

I fixed the problem just by correcting paths to my individual assets, scripts etc.

i was using:

src="/assets/image.png"

instead of:

src="./assets/image.png"

Correcting that solved the problem for me.

Check paths of assets(images, Jquery preloader and all). Jquery preloader is not finishing because it is not getting right path. I think you have given paths based on localhost and without localhost they are not showing.

Related