View Single Post
Old 10-23-2007, 02:03 AM   #4 (permalink)
CMellor
The Acquainted
Upcoming Programmer 
 
CMellor's Avatar
 
Join Date: Sep 2007
Location: Leeds, UK
Posts: 141
Thanks: 6
CMellor is on a distinguished road
Default

I agree with Wildhoney on using prototype. Before I knew that existed, I was doing AJAX the old fashioned way and I hated it! So much code, and it's not guaranteed to work on all browsers, which is a real hassle.

A simple AJAX call in Prototype is very simple:

Code:
function updateForm(element) {
  new Ajax.Request({
    parameters: Form.serialize(element)
  });
}
Which you'd use with an onsubmit attribute

Code:
onsubmit="updateForm(this); return false"
Make sure the form has an ID, otherwise it won't work.

This is pretty useless code, but it gives somewhat of an idea on how simple it is.
__________________
Not quite a n00b...
CMellor is offline  
Reply With Quote