Finished jQuery example documentation.

This commit is contained in:
Armin Ronacher 2010-04-19 15:59:16 +02:00
parent 6e2be6a0b3
commit a99e408bd1
3 changed files with 119 additions and 13 deletions

View file

@ -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 %}

View 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 %}