NUI - Javascript file not being loaded?

Afternoon all,

Currently dealing with some NUI related scripts, trying to get some HTML screens appearing when needed and whatnot. Hit a wall as such as my HTML pages are loading fine, however it seems the javascript file isn’t.

Now at the moment the JS file is simply meant to hide said HTML upon loading however this isn’t the case, it’s as if it simply doesn’t load.

Now I’ve triple checked the id names for the div tags, added some additional checks in the JS file to check if it is indeed loading, sadly nothing coming up.

For reference, we’ve got my __resource file:

ui_page('nui/html/index.html')

files ({
	'nui/html/index.html',
	'nui/html/test.js',
	'nui/html/test.css',
	'nui/html/cursor.png'
})

Followed by my HTML page:

<html>
	<head>
		<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
		<script src="test.js" type="text/javascript"></script>
		<link href="test.css" rel="stylesheet" type="text/css" />
	</head>
	<body>
		<div id="testingScreen">
			<form>
				<input type = "text" name = "testText">
			</form>
		</div>
	</body>
</html>

And finally, the JS file:

$(function() {
	$('#testingScreen').hide();
});

Now understandably I could of missed something fairly obvious (That’s normally the case right? Spend forever searching and it’s a : instead of a ; )

Any insight into what I might be missing would be great :slight_smile:

your ressource:

ui_page ‘nui/html/index.html’

files (
‘nui/html/index.html’,
‘nui/html/script.js’,
‘nui/html/style.css’,
‘nui/html/cursor.png’
)

I’m confused. Is it “script.js” or, “test.js”? They’re different filenames :stuck_out_tongue:

My apologies, I’ve since corrected this however the issue still persists :frowning:

1 Like