Sorginator Posted September 26, 2019 Share Posted September 26, 2019 Hey guys, I tried to trigger an event from CEF to client-side Javascript. It worked, but the event triggers 4x rather than just 1x. At the CEF apparently, not, because that triggers only 1x, I have tested. Nevertheless, 4 chatbox outputs arrive when I execute the following code... Does anyone have any idea what this could be? HTML & JS CEF <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <link rel="stylesheet" href="style.css"> </head> <body> <div class="all"> <div class="Testdiv" id="TestDiv1"></div> <script> document.getElementById("TestDiv1").addEventListener('click', function (event) { mp.trigger('testEvent1', event); var elem = document.getElementById("TestDiv1"); elem.parentNode.removeChild(elem); }); </script> </div> </body> Clientside Script mp.events.add('testEvent1', (testArg1) => { mp.gui.chat.push("Testtext: " + testArg1); }); I also tried an alternative spelling in the script part of the HTML / Javascript code $('#Testdiv').click(() => { mp.trigger('testEvent1', "Blabla"); }); Link to comment Share on other sites More sharing options...
Sorginator Posted September 29, 2019 Author Share Posted September 29, 2019 I have solved the problem: There seemed to be a conflict of resources and a problem with already deleted files that were still local to my PC. The solution to the problem was to empty client files and move all other resources out first Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now