Created
September 27, 2012 18:55
-
-
Save cgrusden/3795738 to your computer and use it in GitHub Desktop.
Save data when a form posts
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
<script> | |
$(document).ready(function() { | |
$('form:first').bind('submit', function() { | |
search = $(this).find('.input_text').val(); | |
$.get(['https://serveletserve.herokuapp.com/PUBLIC_API_TOKEN_1234/track/twitter/cgrusden/searched_for', search].join("/")); | |
}); | |
}); | |
</script> | |
<html> | |
<body> | |
<form> | |
Term to search for?<input name="search_term" class="input_text"/> | |
<input type="submit"/> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment