HTML NUI <img> not found

Hello. I’ve been working on an ingame MDT/CAD recently, and I’ve been working on the UI. So far I’ve setup NUI, and theres no problem with that.

I’ve gotten to the stage where I’m trying to display an image on the “tablet” but its just giving me the broken image icon, no matter how i set up the folder hierarchy, or the tag itself.

 <html>
   <head>
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <script src="nui://game/ui/jquery.js" type="text/javascript"></script>
      <link href="style.css" rel="stylesheet" type="text/css" />
     
   </head>
   <body>
      <div class="tablet">
         <div class="content">
           <div class ="blackbar"><font size="-1">Welcome</font></div>
            <br>
            <br>
            <img src="homescreen.jpg" alt="image failed to load">
  
         </div>
      </div>
    
      <script src="script.js" type="text/javascript"></script>
   </body>
</html>

The image name is correct, its in the same folder, ive tried with multiple images of multiple different resolutions. Kinda stumped here?

Any help is appreciated, thank you!

Is the image in the resource.lua? so like

file "homescreen.jpg"

// or
files {
    "index.html"
    // bla
    "homescreen.jpg"
}
```

Oh my god.

My bad, haha, I should have checked.

Thanks a lot though.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.