NUI what im doing wrong?

So im trying to pass data from client.lua to js and im doing this

Client.lua :

function EnableGui(enable)

SendNUIMessage({
    type = "enableui",
    enable = enable
})

end

JS :
$(document).ready(function() {

console.log("teste");
window.addEventListener("message", function(event) {
	// var data = event.data;
	if (event.data.type == "enableui") {
	console.log("testev2");
	
	}

  });

});

so the log of test is appearing but the text of textv2 is not appearing can someone help me please

maybe the problem is because i have two js, and he loads the first one… is there a chance of loading it in the secound one?