You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

738 B

Javascript - AJAX

Lesson Objectives

  1. Explain AJAX
  2. Demonstrate jQuery AJAX
  3. Explain promises
  4. Explain Cross Site AJAX
  5. Explain JSONP
  6. Explain CORS

Explain AJAX

Demonstrate jQuery AJAX

<!DOCTYPE html>
<html>
	<head>
		<title></title>
		<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
	</head>
	<body>
		hi
		<script type="text/javascript">
			$(function(){
				$.ajax({
					url:'http://www.omdbapi.com/',
					method: "GET",
					data: { s: "star wars" },
					success: function(data, status, jqXHR){
						console.log(data);
					},
					error: function(jqXHR, status, error){
						console.log('bad');
					}
				});
			});
		</script>
	</body>
</html>