JQuery Ajax gibt die gesamte Seite zurück

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: JQuery Ajax gibt die gesamte Seite zurück

by Guest » 19 Jan 2025, 18:16

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);
}
});
});

Top