• 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

PHP Fatal error: Class not found - PHPUnit

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

Laravel relationship belongsToMany with composite primary keys

advanced custom fields wordpress custom class

Is it possible to re-use an array taken from PHP via JSON in a $.ajax function?

error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure

retrieve data from database using session

How to override header set in Apache config with more specific header in a virtual host

Is it possible to re-use an array taken from PHP via JSON in a $.ajax function?

Parameter is not sent to Laravel route in Ajax

Laravel Sanctum CSRF not authenticating

httpd.conf on Windows: can't locate API model structure `php8_module`

Confirm Leave on External Links in Wordpress

Elasticsearch - Want to sort by field in all indices where that particular field available or not if not then avoid it

HTML and PHP in one file

About Contact Privacy policy Terms and conditions