stelarossa stelarossa -4 years ago 97
HTML Question

jQuery load() doesnt load images linked inside html file that is loading?

Basicly I'm loading an external html file to an element using jQuery

.load()
method,but when the file loads it doesn't show images. I have tried changing the path to the images but nothing happened.
My file structure:

-folder_img
--image
-folder_loads
--file_to_be_loaded
-index.html


I have tried
../folder_img/image
and
folder_image/image
inside src attribute of my image tag inside file_to_be_loaded,but it just whant work.If anyone could help it would be greatly appreciated :)

the way I'm loading it:

switch(dataValue) {
case("about"):
popover.css("background", "#37474f");
popoverContent.load("loads/about.html");
console.log(popoverContent);
break;
case("work"):
popover.load("loads/work.html");
break;
case("testimonials"):
popover.load("loads/testimonials.html");
break;
case("contact"):
popover.load("loads/contact.html");
break;
}


Also to mention,whan I open the file that I am loading directly in chrome images are showed...

Answer Source

you can try this: /folder_image/image.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download