title: how to handle 404 error in jquery.post
body: <p>i do not know how to handle 404 error on $.post()??</p>
  
  <pre><code>$.post(url, data, function(returnedData) {
  </code></pre>
  
  <p>it can handle only the success data but i want to handle the 404 error also in.i know how to do it with ajax but dont know with this function please help.</p>
  
  <pre><code>    function returnData(url,data,type){
          $.post(url, data, function(returnedData) {
          if(type == "contacts")
          {   
          ko.applyBindings(new ContactsViewModel(returnedData,"#KnockOutContacts",url,data),$("#KnockOutContacts")[0]);   
          ko.applyBindings(new ContactsViewModel(returnedData,"#ContactDetails",url,data),$("#ContactDetails")[0]);   
          }
          else if(type == "logs")
          {
          alert(returnedData);
          alert(1);
          ko.applyBindings(new LogsViewModel(returnedData,url,data),$("#KnockOutLogs")[0]);   
          }
          else if(type == "sms")
          {
              ko.applyBindings(new SmsViewModel(returnedData,"#KnockOutSmsData",url,data),$("#KnockOutSmsData")[0]);  
              ko.applyBindings(new SmsViewModel(returnedData,"#KnockOutSms",url,data),$("#KnockOutSms")[0]);  
          }
          else if(type == "calendar")
          {
          ko.applyBindings(new CalendarViewModel(returnedData,"#KnockOutCalendar",url,data),$("#KnockOutCalendar")[0]);   
          }
          else if(type == "search")
          {
          ko.applyBindings(new SearchViewModel(returnedData,"#searchbox",url,data),$("#searchbox")[0]);   
          }
          else if(type == "location")
          {
          ko.applyBindings(new LocationViewModel(returnedData,"#KnockOutMaps",url,data),$("#KnockOutMaps")[0]);   
          }
          else if(type == "photos")
          {
          ko.applyBindings(new PhotosViewModel(returnedData,"#photogallary",url,data),$("#photogallary")[0]); 
          ko.applyBindings(new PhotosViewModel(returnedData,"#PhotosDown",url,data),$("#PhotosDown")[0]); 
          }
      });
  }
  </code></pre>
  
  <p>i bascially apply bindings when i get data but when i dont get data it doesnt go inside the success function and thats breaking my js.</p>