sciter-sdk / pysciter

Python bindings for Sciter
https://sciter.com
MIT License
396 stars 40 forks source link

Does tiScript affect script running #49

Closed ylm-king closed 3 years ago

ylm-king commented 3 years ago

In this code, the code in script is not executed.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <h1 id="hello" t="zs">您好, 我的世界!</h1>
</body>

<script type="text/tiscript">
    $(#hello).on('click',
        () => {
            stdout.println("'点击事件调用成功。'")
            $(#hello).text = view.get_newName();
        }
    )
</script>

<script>
    document.querySelector('#id').text = '世界在转!'
</script>
</html>

Please confirm the problem

pravic commented 3 years ago

h1 is not a button. Replace it with <button> or <widget type=button /> or add h1#hello { behavior: clickable; } to your CSS.