Do not show my NUI

Well I’m doing a bar progressed and after several attempts and try a lot of things you can never call the ui.
So I come to seek help, I hope someone helps me

client

AddEventHandler('playerSpawned', function(spawn)
	SendNUIMessage({type = 'putomenu'})
end)



js


$(function() {
	/* open the UI for user */
	window.addEventListener('message', function(event) {

		
		if (event.data.type == 'putomenu'){
            $('.putomenu').css('display', 'block')	
            $('progress').css('display', 'block')
		} else if (event.data.type == "putoOFF"){
            $('.putomenu').css('display', 'none')	
            $('progress').css('display', 'none')
        }
	})
});

html

<!doctype html>
<html>
	<head>
		<link href="css/style.css" rel="stylesheet">
		<script src="js/app.js" type="text/javascript"></script>
		<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
		<style>
			.putomenu {display: none;}
			progress{display: none;}
        </style>
	</head>
	<body>
		
	<div class="putomenu" >
		<progress value="22.9" max="100">
		</progress>
	</div>

		<script src="js/app.js" type="text/javascript"></script>
	</body>
</html>

Thaks everyone for reading

Do the same as this, but then another event message like enableUI and set the body to display block/none.

See [How-To] Use NUI (UI Creation with HTML)