Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sendstuff(data) {
- $.ajax({
- type:"POST",
- datatype:'json',
- cache: false,
- data: data,
- url:"/Orders/getitem/",
- success:function(resp, status, jxr){
- alert(resp);
- if(resp.fail == "error") {
- // error handling, show data.message or what you want.
- location.reload(true);
- } else {
- // same as above but with success
- $('body').html(resp);
- }
- });
- return false;
- };
- if ( $status != 201 ) {
- // $this->Flash->error(__('There was an error with the entry. Please, try again.'));
- $ajaxerr['fail'] = 'error';
- echo json_encode($ajaxerr);
- die("Error: call to URL $url failed with status $status, response $result, curl_error " . curl_error($ch) . ", curl_errno " . curl_errno($ch));
- {"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