Skip to content

Instantly share code, notes, and snippets.

@mrfratello
Created February 12, 2017 17:30
Show Gist options
  • Save mrfratello/d47b495fb62b0227341bd852748c5fe6 to your computer and use it in GitHub Desktop.
Save mrfratello/d47b495fb62b0227341bd852748c5fe6 to your computer and use it in GitHub Desktop.
html template with example of ajax-request using jQuery library.
<!DOCTYPE html>
<html>
<head>
<title>AJAX on jQuery Example</title>
</head>
<body>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
jQuery.ajax({
url: '/some_page',
method: 'POST',
data: {
foo: 'bar',
hello: 'world'
},
complete: function() {
console.log('ajax is sended');
}
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment