• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

AJAX call fails with SyntaxError: Unexpected end of JSON input

javascriptphpjqueryajax


PHP Snippet 1:

var data = {};
 data['rawFiles'] =$('#projectIDs').val(); 
 data['metadata'] = $('#getData').val();
  data['type']=  $('#submitType').val();
  data['pid']='csv';
   data['command']='data/qcTest'

PHP Snippet 2:

$.ajax({type: "POST", url: posturl, data: JSON.stringify(data), dataType: 'json'})

Related Snippets

Uploading video to Youtube using Youtube Data API V3 and Google API Client PHP -- getting 401 (unauthorized) message

How to load Codeigniter 4 lang file into an array variable

Laravel php artisan serve to mimic HTTPS

Apply filter array/return terms

PHP array_filter with arguments

What is PHP's equivalent of JavaScript's "array.every()"?

SQLSTATE[HY000]: General error: 1 table posts has no column named *

laravel 5.6 bulk inserting json data

Submitting a form with ajax in Wordpress

PHP: Convert any string to UTF-8 without knowing the original character set, or at least try

Fatal error: Array callback has to contain indices 0 and 1

onKeyUp event calculation not working on the following rows from php generated forms except the first one

Array to string conversion

Add customer email and phone in "Order" column to admin orders list on Woocommerce

carbon generated datetime not stored correctly into the database

About Contact Privacy policy Terms and conditions