• 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

RuntimeException: Unable to create the cache directory (/var/www/sonata/app/cache/dev)

Upload a file Using PHP and JavaScript

Multiple order by in WooCommerce

Magento 2 - Controller returning blank page

SMTP "Error: DATA not accepted from server!" Opencart 2.3 on InMotionHosting

laravel automatically deletes server.php on php artisan serve

PHP rotate matrix counter-clockwise

HTML and PHP in one file

Modify microseconds of a PHP DateTime object

PHPExcel file download using AJAX call

Alert message after submitting form in PHP

In PHP, which is faster: preg_split or explode?

Get latest Tweets - What API

SQL to convert multiple rows into a single row of variable length

Appending data to an anchor tag

About Contact Privacy policy Terms and conditions