Logic Machine Forum
Object does not trigger a custom javascript - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Object does not trigger a custom javascript (/showthread.php?tid=3406)



Object does not trigger a custom javascript - Kilogica - 07.06.2021

Hello,

we want to reload a page by triggering a KNX object in Wiser for KNX, we reused a javascript that works fine on every device (so the code is fine) but in this case it doesn't work.

Javascript console has this warning:

DevTools failed to load source map: Could not load content for http://192.168.178.8/scada/resources/minizip-asm.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

we have a VPN and everything seems to work fine on that side, any ideas?

Thank you for your help.


RE: Object does not trigger a custom javascript - Daniel - 07.06.2021

Paste all you have in custom JS


RE: Object does not trigger a custom javascript - Kilogica - 07.06.2021

$(function(){
grp.listen('32/5/98', function(object, state) {
var value = object.value;
console.log("dopo listen");
if (value == 1) {
console.log("evento1");
const body = document.body;
body.click();
if (!localStorage.getItem("reload")) {
localStorage.setItem("reload", "true");
location.reload();
}
} else if (value == 0) {
console.log("evento2");
localStorage.removeItem("reload");
} else {
localStorage.removeItem("reload");
console.log("niente");
};
});
});

Smile We found the problem,

the script worked fine but on some browser the cache must be deleted.


Big Grin our bad, but thank you for your help.