I'm attempting to create a post value from an on click event.
From here:
$(document).ready(function(){
$("div").click(function(){
var pastDATE = $(this).text();
alert(pastDATE);
}); //end click
}); //end ready
I've tried numerous variations on the following code in attempt to get the post variable to work but am obviously missing something critical.
$(document).ready(function(){
$("div").click(function(){
var pastDATE = $(this).text.post("CalendarFunction.php", function() {
alert("success");
})
.done(function() {
alert("second success");
})
.fail(function() {
alert("error" );
})
.always(function() {
alert("finished");
});
});
The error console is telling me I have an undefined object. Can someone show me how to fix this?
$(this).text()?