NUI not loading images

Just having issues getting a few png thumbnails to load via NUI, everything else is working as expected with reguards to js, cs, html, and lua. Hoping this is an easy solution, having been searching and trying for days.

There is nothing in CSS or JS to hide images in DOM, the images just break, standard html broken image icon.
i have tried many url variants such as.
nui://nui/image.png etc, no solutions as of yet.

__resource.lua "the images are just test images, i have tried all shapes and sizes and variations of png.

ui_page "nui/ui.html"
-- Add the files that need to be used/loaded
files {
	"nui/ui.html",
	"nui/ui.js", 
	"nui/ui.css",
    "nui/120px-Police.png",
    "nui/Chip.png"
}
-- Initiate the clientside lua script 
client_script 'cl_action.lua'

ui.html

<!doctype html>
<html>
    <head>
        <script src="nui://game/ui/jquery.js" type="text/javascript"></script>
        <script src="ui.js" type="text/javascript"></script>
        <link href="ui.css" rel="stylesheet" type="text/css"/>
    </head>
<body>
        <div id="actionmenu" style="display: none;">
<!-- Main Menu -->
            <div id="mainmenu">
            <div class="pages" style=""> 
           <big><b>Main Menu</b></big><br />
                <img src="nui/120px-Police.png" id="veh" />
                 <img src="nui/Chip.png" id="veh2" />
            </div>
                </div>
			<!-- Do not remove this or you will not be able to exit the menu --> 
			<button class="menuoption" data-action="exit"><big><b>Close<b></big></button>
           <div style="float:left;clear:right;position: absolute;bottom:2px;"><b><big>Z-ablet</big> <small><i>by @ShawnDaGeek</i></small></b>
        </div>
</div>
</body>
</html>

HI,

You have ui.html in the folder nui and file acces is relative to your html file, like:

<img src="Chip.png" id="veh2" />
1 Like

Thank you so much for the response, and you are very correct. After reading your post i changed back to the relative path and the resource would not load.

Turns out that in addition to that change i had to restart / clear server cache as well. I am guessing NUI does not clear browser plugin cache on resource reload.

Sigh, lol thank you for slowing me down.

hi, I have the same as him but its still not working for me and I tried in a different folder like images and without that folder that the image is besides the index.html but no luck.