Advertisement
Guest User

Untitled

a guest
Aug 27th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. function sendstuff(data) {
  2.  
  3.  
  4. $.ajax({
  5. type:"POST",
  6. datatype:'json',
  7. cache: false,
  8. data: data,
  9. url:"/Orders/getitem/",
  10. success:function(resp, status, jxr){
  11. alert(resp);
  12. if(resp.fail == "error") {
  13. // error handling, show data.message or what you want.
  14. location.reload(true);
  15. } else {
  16. // same as above but with success
  17. $('body').html(resp);
  18.  
  19.  
  20.  
  21. }
  22. });
  23. return false;
  24. };
  25.  
  26. if ( $status != 201 ) {
  27. // $this->Flash->error(__('There was an error with the entry. Please, try again.'));
  28. $ajaxerr['fail'] = 'error';
  29. echo json_encode($ajaxerr);
  30. die("Error: call to URL $url failed with status $status, response $result, curl_error " . curl_error($ch) . ", curl_errno " . curl_errno($ch));
  31.  
  32. {"fail":"error"}Error: call to URL https://api.blank failed with status 400, response {"name":"VALIDATION_ERROR","details":[{"field":"blank.fng_ints[0].ct_issue","issue":"date cannot be in the past."}],"message":"Invalid request. See details.","information_link":"https://developer.api/#VALIDATION_ERROR","debug_id":"24f4"}, curl_error , curl_errno 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement