python-eel/Eel

Cannot read properties of undefined (reading 'send')

Open

#650 建立於 2022年12月10日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)Python (570 fork)batch import
help wanted

倉庫指標

Star
 (5,980 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Problem "Uncaught TypeError: Cannot read properties of undefined (reading 'send')" when i trying run a function with "eel.nice()" inside.

app.py

@eel.expose
def nice():
    print("GG")

topnav.html

        checkBox = document.getElementById('flexSwitchCheckDefault').addEventListener('click', event => {
            if(event.target.checked) {
                eel.nice()
                document.getElementById("languageSelect").setAttribute("disabled", '');
            }
            else {
                eel.nice()
                document.getElementById("languageSelect").removeAttribute("disabled");
            }
        });

This problem only appears if you put another code file using jquery. Is there an option when importing another html file to fix the problem or will EEL only work directly? Script in index.html:

 $(function(){
      $("#includedContent").load("topnav.html"); 
    });

image

Desktop

  • OS: Windows 10 Pro
  • Browser: chrome
  • Version 110.0.5468.0, canary (64 bit)

貢獻者指南