Finished jQuery example documentation.
This commit is contained in:
parent
6e2be6a0b3
commit
a99e408bd1
3 changed files with 119 additions and 13 deletions
|
|
@ -1,12 +1,6 @@
|
|||
<!doctype html>
|
||||
<title>jQuery Example</title>
|
||||
<script type=text/javascript
|
||||
src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
|
||||
<script type=text/javascript src="{{ url_for('static', filename='app.js')
|
||||
}}"></script>
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
<script type=text/javascript>
|
||||
var $SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
|
||||
|
||||
$(function() {
|
||||
$('a#calculate').bind('click', function() {
|
||||
$.getJSON($SCRIPT_ROOT + '/_add_numbers', {
|
||||
|
|
@ -15,6 +9,7 @@
|
|||
}, function(data) {
|
||||
$("#result").text(data.result);
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
@ -23,3 +18,4 @@
|
|||
<input type=text size=5 name=b> =
|
||||
<span id=result>?</span>
|
||||
<p><a href=# id=calculate>calculate server side</a>
|
||||
{% endblock %}
|
||||
|
|
|
|||
10
examples/jqueryexample/templates/layout.html
Normal file
10
examples/jqueryexample/templates/layout.html
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<!doctype html>
|
||||
<title>jQuery Example</title>
|
||||
<script type=text/javascript
|
||||
src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
|
||||
<script type=text/javascript src="{{ url_for('static', filename='app.js')
|
||||
}}"></script>
|
||||
<script type=text/javascript>
|
||||
var $SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
|
||||
</script>
|
||||
{% block body %}{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue