Created
March 15, 2015 15:01
-
-
Save ssbb/9ca3a9db2eb153609951 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "layout.html" %} | |
{% block body %} | |
<input type="text" id="interaction"> | |
<input type="submit" value="submit" id="submit"> | |
<script type="text/javascript" src="/static/js/jquery-1.11.1.min.js"></script> | |
<script type="text/javascript"> | |
$(document).on('ready', function() { | |
$(document).on('keyup', '#interaction', function(e) { | |
if (e.keyCode == 13) { | |
$("#submit").click(); | |
} | |
}); | |
$(document).on('click', '#submit', function() { | |
alert('YAHOO!'); | |
}); | |
{% if query %} | |
$("#interaction").val("{{query}}"); | |
$("#submit").click(); | |
{% endif %} | |
}); | |
</script> | |
{% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment