24 lines
1.0 KiB
HTML
24 lines
1.0 KiB
HTML
<!doctype html>
|
|
<html>
|
|
|
|
<head>
|
|
<title>The jQuery Example</title>
|
|
|
|
<h2>jQuery-AJAX in FLASK. Execute function on button click</h2>
|
|
|
|
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"> </script>
|
|
<script type=text/javascript> $(function() { $("#mybutton").click(function (event) { $.getJSON('/SomeFunction', { },
|
|
function(data) { }); return false; }); }); </script>
|
|
<script type=text/javascript> $(function() { $("#mybutton2").click(function (event) { $.getJSON('/SomeFunction2', { },
|
|
function(data) { }); return false; }); }); </script>
|
|
<script type=text/javascript> $(function() { $("#mybutton3").click(function (event) { $.getJSON('/SomeFunction3', { },
|
|
function(data) { }); return false; }); }); </script>
|
|
</head>
|
|
|
|
<body>
|
|
<input type = "button" id = "mybutton" value = "Click Here" />
|
|
<input type = "button" id = "mybutton2" value = "Click Here" />
|
|
<input type = "button" id = "mybutton3" value = "Click Here" />
|
|
</body>
|
|
|
|
</html> |