[HELP] Is there a way to add Global JS/CSS files?


#1

Hi there,

There are some lines (e.g in the scoreboard resource) like the following:

<script src="nui://game/ui/jquery.js" type="text/javascript"></script>

Is there any way to add custom global JS files, like JQuery, by yourself? I searched the whole Server & Client directory, but couldn’t find a hint where this jquery file is coming from.

Thanks,
Johnny


#2

Your resource is referenced as nui://[resource name], as well, so if you have a resource called ‘dogfood’ you can import a file from it using nui://dogfood/food.js.


#3

Alright got it, and I guess game/ui/jquery.js is something hardcoded into FiveM itself? Because I can’t find it as a normal resource


#4

It’s in citizen/ui.rpf.


#5

Perfect, Thanks for the quick answers! :smile: