I'm making a toggle in my Eel app, but for some reason it does not print Test to the terminal.
<div class="container-afk">
<label class="toggle_box">
<input type="checkbox" id="checkbox">
<div class="circle"></div>
<h3 class="afk-text">AFK Reply</h3>
</label>
</div>
Javascript in my index.html file
<script src="eel.js"></script>
<script src="script.js"></script>
<script>
function AfkOn() {
console.log('Checkbox clicked');
var checkbox = document.getElementById('checkbox');
if (checkbox.checked) {
eel.AfkOn();
}
}
</script>
Python
@eel.expose
def toggleAfk():
print('Test')
There are no errors in the console of the app or in the terminal. I can't find anything online about how to fix it. I have tried rewriting it and to no luck idk what's causing this.
It seems that you are declaring a function in your Python called toggleAfk() but in your JavaScript code you are naming it AfkOn() have you tried changing them so they are both the same?
i.e. change eel.afkOn() to eel.toggleAfk()
I've never worked with Eel though so I could be wrong...