• 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

Passing PHP JSON to Javascript: echo json_encode vs echo json declaration

PHP Deprecated issue when running artisan command

could not find driver Debian SQL Server PHP

Spam Filter in Contact Form

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

Custom add to cart button URL for specific product in WooCommerce?

PHP Fatal error: Class not found - PHPUnit

Why rand() every time I refresh the page?

Symfony process run throws exception - executing on command line works

How to trim a video by 4 fragments to 4 seconds using the PHP-FFMpeg?

how to hide previous markers when new markers added in google map javascript api

How to remove from a multidimensional array all duplicate elements including the original?

Uncaught TypeError: Cannot read property 'length' of null when retrieving tags from wp

How avoid Moved Permanently The document has moved here

PHPExcel file download using AJAX call

About Contact Privacy policy Terms and conditions