jQuery POST vs GET (problem) in Apache Cordova

jQuery POST vs GET (problem) in Apache Cordova

Hi to all, 

Firstly I´d like to apologize for my English if it is not correct. 

I have a problem passing variable from jQuery POST method to my PHP file. I am coding in Apache Cordova for Android. I have this function in JS file: 

  1. //.....deletes clicked invitation .......... //
  2. function invitation_delete() {
  3.     $(document.body).on( 'tap', '.events_pinned_invitations_button_delete', function () {
  4.         console.log("ok");
  5.         var invitation_id = ($(this)).data("invitation_id");
  6.         console.log(invitation_id);
  7.         $.post('http://10.0.0.2/habitoo15/mobile/invitations_delete.php' , {invitation_id: invitation_id}, function(data) {
  8.             console.log(data);
  9.         });
  10.     });
and this is php file: 

  1. $invitation_id = $_POST['invitation_id'];
  2. echo $invitation_id;
If I click the button, console will output: 
"ok"     ...       ( expected )
"1"       ...     ( expected - right number )
" "        ...     ( unexpected, seems like variable got lost on the way and it takes like 5 seconds before console outputs last line )

If I use GET method insted of POST ( in both files ), console will output:
"ok"          
"1"             
"1" 
as I would expect. Also I need to pass 2 variables ( second one being string ). If I try that, then the "1" passes ok but the string is cutted in the middle and console outputs just first part of it. 

Thanks for any help or explanation. 

Tomas