title: How to get/post/delete/put information with jQuery and AJAX
body: <p>I trying to do a DELETE, PUT, GET and POST a request with ajax and jquery.</p>
  
  <p>The method POST works well by creating a new record, but I cannot make it work the other methods (PUT, DELETE and GET).</p>
  
  <p>This is the code (it works fine, it creates the new record but it doesn't reach the "success" event):</p>
  
  <pre><code>var jsonExample = {"advertisement":{"title":"test"}};
  
  $.ajax({
              type: "POST",
              url: "http://example.com/advertisements.json",
              data:jsonExample,
              success: function(response){
                      alert("test");
              }
  });
  </code></pre>
  
  <p>When I change the type "POST" to "DELETE" or "PUT" I have the follow error: </p>
  
  <blockquote>
    <p>NetworkError: 404 Not Found</p>
  </blockquote>
  
  <p>And when I change it to "GET" it throws the following message:</p>
  
  <blockquote>
    <p>200 OK</p>
  </blockquote>
  
  <p>But it don't any other responses. It should be something like this:</p>
  
  <pre><code>{"advertisement":{"created_at":"2012-04-17T13:20:17Z","from_age":null,"neighbourhood_id":null,"title":null,"date_to":null,"days":null,"promotion_id":null,"updated_at":"2012-04-17T13:20:17Z","date_from":null,"gender":null,"id":3,"display":null,"desc":null,"budget":null,"image":null,"to_age":null,"department_id":null,"town_id":null}}
  </code></pre>
  
  <p>The </p>
  
  <p>Please note: my app is getting this info from a remote server, but I don't know if that has something to do with this problem. Because I've run it in Google Chrome and I've received the <strong>Access-Control-Allow-Origin</strong> message on the browser's console.</p>
  
  <p>Any ideas?</p>