Page 1 of 1

JQuery Ajax gibt die gesamte Seite zurück

Posted: 19 Jan 2025, 18:16
by Guest
Ich habe eine Jquery-Ajax-Funktion, die Daten an ein PHP-Skript sendet, und das Problem liegt beim Rückgabewert, er gibt die gesamte Seite statt eines einzelnen Werts zurück.

Code: Select all

$("#ajaxBtn").click(function(){
var inputText = $("#testText").val();

$.ajax({ type: "POST",
url: "index.php",
data: "testAjax="+inputText,
dataType: "html",
success: function(html){
alert(html);
}
});
});