Skip to content

Instantly share code, notes, and snippets.

@pgbovine
Created November 25, 2014 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pgbovine/21dd0f2024fcd317baf4 to your computer and use it in GitHub Desktop.
Save pgbovine/21dd0f2024fcd317baf4 to your computer and use it in GitHub Desktop.
copy into profile.html
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#getData").click(function() {
$.getJSON('/lotsofdata', function(dat) {
console.log("Ajax received data!");
console.dir(dat);
});
});
});
</script>
</head>
<body>
{% if name %}
<h1 style="color: red;">Hello, {{ name }}!</h1>
{% else %}
<h1>Hello noname!</h1>
{% endif %}
<button id="getData">Get Data</button>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment