This repository was archived by the owner on Jun 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 606
Expand file tree
/
Copy pathsample.html
More file actions
35 lines (31 loc) · 1.48 KB
/
sample.html
File metadata and controls
35 lines (31 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!-- Below is from: https://github.com/samuelhwilliams/Eel/blob/master/examples/05%20-%20input/web/main.html -->
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css" integrity="sha384-Zug+QiDoJOrZ5t4lssLdxGhVrurbmBWopoEl+M6BdEfwnCJZtKxi1KgxUyJq13dy" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<!-- Include eel.js - note this file doesn't exist in the 'web' directory -->
<script type="text/javascript" src="/eel.js"></script>
<script type="text/javascript">
$(function(){
eel.expose(say_hello_js); // Expose this function to Python
function say_hello_js(x) {
console.log("Hello from " + x);
}
say_hello_js("Javascript World!");
eel.handleinput("connected!"); // Call a Python function
$("#btn").click(function(){
eel.handleinput($("#inp").val());
$('#inp').val('');
});
});
</script>
</head>
<body>
<h1>Input Example: Enter a value and check python console</h1>
<div>
<input type='text' id='inp' placeholder='Write anything'>
<input type='button' id='btn' class='btn btn-primary' value='Submit'>
</div>
</body>
</html>