Ajax, php problem z prostym przesyłaniem

0

Witam, mam problem z wysyłaniem prostych danych poprzez AJAX. Oto mój kod java script :

 

var i = parseInt(jid[1]);
		var j = parseInt(jid[2]);
		var hex_number = i*10+j+1;
		var maps_number= jid[3];
		
		// ajax
		var data = "hex_number=" + hex_number + "&maps_number=" + maps_number;
		$.ajax({
			type: "POST",
			url: "response.php",
			success: function(response){
			alert(response);
	}
	});

oraz plik który wysyła odpowiedź response.php:

<?php
	$hex_number = $_POST['hex_number'];	
	echo $hex_number;
?>

W odpowiedzi w funkcji alert wyświetla mi ERROR. Może mi ktoś powiedzieć dlaczego to nie działa;)?

1
$.ajax({
	type: "POST",
	url: "response.php",
	success: function(response){
		alert(response);
	},
	data: data
});

:P

1 użytkowników online, w tym zalogowanych: 0, gości: 1