Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Ajax

Hi,

Going over the Ajax course again to get it all refreshed and I hear Dave talking about using Ajax to send the data to a .php file (example), and now I'm wondering why you would use Ajax to send the data from a form to a .php file/script when you could just pass the action and method attributes to the form-tag?

1 Answer

Hey. You might not want to pass an input parameter to a php file, you may want to trigger a php script on the web server following a users interaction with your web page or something like that.

With any form of development there's more than 1 way to skin a cat, but just because you can do something it doesn't mean that it's the best way.