Problem submit data for php-Script via jquery-ajax
Hi I have a problem within a Jquery-Script using the get-method to transmit data to a PHP-Script.
Here is the code
- function handleDragStop( event, ui ) {
var offsetXPos = parseInt( ui.offset.left );
var offsetYPos = parseInt( ui.offset.top );
alert( "Drag von/nach!\n\nat: ("+ startXPos +"," + startYPos + "/" + offsetXPos + ", " + offsetYPos + ")\n");
$.ajax({
type: 'GET',
//url: "ajax_div_wochenelement_drag_drop.php",
url: "drag_drop_funktion_per_get_testen.php",
data: 'startxpos=' + startXPos + '&startypos=' + startYPos,
dataType: "html"
/*method: "GET",
data: { startxpos : startXPos, startypos : startYPos },
// 'stopxpos': 'offsetXPos', 'stopypos': 'offsetYPos'
dataType: "html"
*/
});
request.done(function( msg ) {
$( "#log" ).html( msg );
});
request.fail(function( jqXHR, textStatus ) {
alert( "Request failed: " + textStatus );
});
}
When I do a drag and drop on the html-Page I become the alert-Message with all coordinats when the drop-event was thrown out. But it seams that the data to the PHP-Script was not submitted, because the PHP-Script should simple insert the values in a Database and the table is still empty.
At Moment I only test with the Dragcoordinates - with StartX and StartY the other both variables are commented out and not in use for the transmitting.