Set correct headers for NUI callbacks

This commit is contained in:
Jamelele
2020-05-24 21:04:06 +00:00
parent 4ec8391b6f
commit 285cee53a0

View File

@@ -620,6 +620,13 @@ function displayKeyLock( state )
}, 2000 ); }, 2000 );
} }
// Prepare headers for HTTP requests
$.ajaxSetup({
headers: {
'Content-Type': 'application/json; charset=UTF-8',
},
});
// This function is used to send data back through to the LUA side // This function is used to send data back through to the LUA side
function sendData( name, data ) { function sendData( name, data ) {
$.post( "https://" + resourceName + "/" + name, JSON.stringify( data ), function( datab ) { $.post( "https://" + resourceName + "/" + name, JSON.stringify( data ), function( datab ) {
@@ -1033,7 +1040,7 @@ $( "body" ).find( "button, div" ).each( function( i, obj ) {
------------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------------*/
function closeRemote() function closeRemote()
{ {
sendData( "closeRemote", {} ); sendData( "closeRemote", null );
setEleVisible( elements.plateReaderBox, false ); setEleVisible( elements.plateReaderBox, false );
setEleVisible( elements.uiSettingsBox, false ); setEleVisible( elements.uiSettingsBox, false );