• 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

Add restriction to WooCommerce coupons by allowed user ID

Apply session id from request header

Upload a file Using PHP and JavaScript

Must be of the type array, null given,

Explode not working properly with dash

Laravel Displaying image from database

500 Internal Server Error on Ajax request. Not sure the origin of the problem

How to Display Data in Yajra Datatables Laravel 7?

how to validate form data in codeigniter 4

Laravel/ PHP: Order By Alphabetical with numbers in order [duplicate]

Increase value by 1 on button click

Parsing JSON File to array in PHP

Nginx RTMP not recording

Custom Button next to “ADD TO CART” button of WooCommerce based on Product Type

Custom Button next to “ADD TO CART” button of WooCommerce based on Product Type

About Contact Privacy policy Terms and conditions