Here is some slightly modified example code that jQuery had on their site:
$.post("test.php", {gpa: 4, sat: 1600},
function(data) {
alert(data);
}
);
I don't understand the function(data) part. What the heck is that called? A useless function? I've never seen a function declared without a name, but that's just me. An explanation would be appreciated.Also, suppose I have a HTML form input box with the name "gpa" - how do I use jQuery to get the value submitted?
Edit: I tested that out, and it works. But I'm still very confused on the function(data) thing. Embedded functions as arguments freak me out.
Thanks!
This post has been edited by AVReidy: 01 May 2012 - 07:05 PM

New Topic/Question
Reply


MultiQuote




|