forked from realpython/materials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimple.html
More file actions
44 lines (44 loc) · 1.5 KB
/
Copy pathsimple.html
File metadata and controls
44 lines (44 loc) · 1.5 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
36
37
38
39
40
41
42
43
44
<!DOCTYPE html >
<html>
<head>
<meta charset="utf-8"/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/pure/2.0.3/pure-min.min.css"
integrity="sha256-jYujp4Kf07YDuUF9i1MHo4AnpXUKuHxIUXH7CrHxdKw="
crossorigin="anonymous" />
<script
src="https://cdnjs.cloudflare.com/ajax/libs/brython/3.9.0/brython.min.js" defer>
</script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/brython/3.9.0/brython_stdlib.min.js" defer>
</script>
<script src="main.py" type="text/python"></script>
<style>
body { padding: 30px; }
aside {
background: lightyellow;
margin: 1em 0;
padding: .3em 1em;
border-radius: 3px;
border: 1px solid gray;
color: gray;
}
</style>
</head>
<body onload="brython(1)">
<h2>Ajax Requests</h2>
<aside><p>Demonstrate the usage of GET using <tt>browser.ajax</tt>.
You need to start a server for this example to work.
You can start the Python development web server with the following command:
<tt>python3 -m http.server</tt>.
</p></aside>
<form class="pure-form" onsubmit="return false;">
<legend>Actions</legend>
<button id="get-btn" class="pure-button pure-button-primary">Async Get</button>
<button id="get-blocking-btn" class="pure-button pure-button-primary">Blocking Get</button>
<legend>Logs</legend>
<textarea id="log" name="log" rows="20" cols="60"></textarea>
</form>
</body>
</html>