Problems loading image by css

Asked

Viewed 173 times

1

I have a library, in the original it was as follows. The archive . css was at the root, and there was a folder called images that css searches for: /images/image.png. Well, we had to make an improvement to that library. Then we created the css folder, the js folder and the images folder. We set up the following folder structure:

gen/modal/viewerPDF/js

gen/modal/viewerPDF/css

gen/modal/viewerPDF/images

gen/modal/viewerPDF/Viewer.html

Note that the main html file was in the root of Viewer’s main folder. Well, what happens is that css mounts, otherwise Viewer would be all messed up and it’s not, but it makes a lot of mistakes, of which put one of the errors here. Solving one solve the others. The error below:

http://10.104.33.247/gen/modal/viewerPDF/css/images/toolbarButton-viewThumbnail.png Failed to load Resource: the server responded with a status of 404 (Not Found)

Looking at the mounted url, it does not exist. There is no such thing:

...css/images....

In css to grab the images I made:

content: url(images/[email protected]);
content: url(../images/[email protected]);
content: url(~/images/[email protected]);

And yet the cited errors demonstrated in Chrome devtools continue. How do I fix this?

This is the header of the page that calls the css and js:

<html dir="ltr" mozdisallowselectionprint moznomarginboxes>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="google" content="notranslate">
    <title>PDF.js viewer</title>

    <link rel="stylesheet" href="css/viewer.css"/>

    <!--<script src="compatibility.js"></script>-->

<!-- This snippet is used in production (included from viewer.html) -->
<!--<link rel="resource" type="application/l10n" href="locale/locale.properties"/>-->
<script src="js/l10n.js"></script>
<script src="js/pdf.js"></script>

    <!--<script src="debugger.js"></script>-->
    <script src="js/viewer.js"></script>

  </head>
  • Could you post the directory structure? The place where you call the CSS and the place where it really is, and the place where the images are?

  • @Hiagosouza, I made an edit and posted the header where are the calls of the css and js files. The directory structure is the one I put in the first post.

  • Pass the page LINK viewer.html. I tried this but did not load: http://10.104.33.247/gen/modal/viewerPDF/viewer.html

  • I restarted the comp and it worked. I’m having a lot of problems with Chrome caching when I change any javascript. And I can only unload with a reboot. And that’s a nuisance for the developer. The posted above is how it is today and in css to get the images I did so: content: url(.. /images/[email protected]);

  • @pnet may seem like a silly question but, have you disabled the Chrome console cache? This makes it much easier

  • This also does not work: content: url(/gen/modal/viewerPDF/images/[email protected]); ??

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.