Right now i am trying to use $(this).insertFUnctionNameHere() when i get the data back from my ajax post request. I tried to do some tests such as $(this).parent().hide(); $(this).slideUp(); to see where it was selecting but it seems that it is selecting nothing? Is this normal or is there a way for me to have $(this) actually be selecting something.
Here is my code.
/*
* This is the ajax
*/
$(".reply").on( "submit" , function(){
// Intercept the form submission
var formdata = $(this).serialize(); // Serialize all form data
// Post data to your PHP processing script
$.post( "/comment.php", formdata, function( data ) {
// Act upon the data returned, setting it to .success <div>
$(this).children().slideUp();
$(this).children('.success').prepend(data);
$('.hidden').hide();
});
return false;
});
/*
* End ajax
*/
Also the link to my website i am using it on is HERE (readysetfail.com)
I don’t know if you’re determined to use $(this), but if not I would save the jQuery object referring to the form (retrieved by using $(this) in the event handler) in a variable and use that in the finish function, like so: