• 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

Laravel - Browser displays message again when I press back button

Only on Firefox "Loading failed for the <script> with source"

The sum of the user's points

Warning file_get_contents () failed to open stream: HTTP request failed! HTTP/1.0 402 Payment Required

Render the content of default_filter.php in Joomla front-end

The difference when using if statement true === something() vs something() === true [duplicate]

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

Array to string conversion

Laravel 8: Array to string conversion while calling route:list

how to create html table in php

Laravel 8 Multiple Relationships for Factory

phpseclib 2.0 can not use Composer to create autoload

Creating Combinations of Elements

Laravel php artisan serve to mimic HTTPS

retrieve data from database using session

About Contact Privacy policy Terms and conditions