Wednesday, November 6, 2013

Day 31

Today, I spent most of the day doing Ajax and the dreaded wall. This whole Facebook idea is really starting to become a pain haha. That and being a "perfectionist." I can't stop until it is perfect or until it starts to interfere with my other work. As for jQuery, I am still a little unsure of what each part of the jQuery syntax means because it has been a few weeks since we have done jQuery. Here is one if the main function we have been using with Ajax.

Ok, I am going to try and explain this; here goes nothing...
First when the document is ready it runs the function. Then skip the next line where the .submit is defined and goes all the way down to where it is called at $('.form').submit().
.form is just what the class of the form is called below (not shown, I only have so much space, give a guy a break). The .submit function is called and goes to .post, which needs 4 pieces of data (copying this from my notes on the page, don't judge). The first line is just saying where the form is going, which is called action="process.php." Goes to that page and turns the data from the form into a string. Then runs the response from the process page and logs the response in the console, which lets you see the string on the browser. Then it's going to alter the HTML on the results (#results) div with the response that was set to notes. The last line just turns it into an empty string (the value of the id message) when you submit.. "Explained" this super fast.

Did that make any sense? Ya, didn't think so. I only have 5 minutes to turn this in, so that is my excuse.

Will post the rest of my wall tomorrow (hopefully),

- Kyle

No comments:

Post a Comment