Ver código fonte

Listing 6.22. Configuring $.ajax() with $.ajaxSetup().

Frederic G. MARAND 9 anos atrás
pai
commit
c16cc7ee5a
1 arquivos alterados com 8 adições e 1 exclusões
  1. 8 1
      Chapter 6/06.js

+ 8 - 1
Chapter 6/06.js

@@ -3,8 +3,15 @@ $(document).ready(function () {
 
   $('#letter-a a').click(function (event) {
     event.preventDefault();
-    $.ajax({
+
+    $.ajaxSetup({
       url: 'a.html',
+      type: 'POST',
+      dataType: 'html'
+    });
+
+    $.ajax({
+      type: 'GET',
       success: function (data) {
         $('#dictionary').html(data);
       }