• 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

Mobile browsers are adding .html to filename on download

Combine array with same value and add other [duplicate]

How can I remove the "Advanced" panel of all blocks in WordPress block editor?

Yoast SEO (WordPress Plugin) - Get plugin generated data manually

Laravel Nova, route not found

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

How can I create a Download Page with post php method?

Laravel 5.1 xmlHttpRequest AJAX POST TokenMismatchException

Show rotation of tweets using current day of month

How to validate tin and cst using PHP?

PHP random string generator

Google API Heatmap Layer exception, why?

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

Get WooCommerce products from specific category

How to auto populate preferredCountries from intl-tel-input with db output

About Contact Privacy policy Terms and conditions