help with unobtrusive ajax with prototype - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: help with unobtrusive ajax with prototype (/showthread.php?tid=10029) |
help with unobtrusive ajax with prototype - El Forum - 07-16-2008 [eluser]ammonkc[/eluser] I need to submit a form via ajax with prototype.js unobtrusively. How do I unobtrusively attach the script to submit with prototype? I've done it with jQuery before, but I need to use prototype on this one. Basically I need to do with prototype.js what the below script does with jquery.js. I would appreciate any help. Thanks Code: $(function() { // onload...do help with unobtrusive ajax with prototype - El Forum - 07-16-2008 [eluser]thinkigniter[/eluser] Hi ammonkc, Welcome to the forum. I'm also a big fan of JQ and have never tried Prototype so I was also interested. So after reading your post I googled prototype ajax form submit. The second link was 24 ways: Easy Ajax with Prototype. So I clicked on this [email=http://24ways.org/2005/easy-ajax-with-prototype]link[/email] and clicked on {[email=http://24ways.org/examples/easy-ajax-with-prototype/]Try the example[/email]} at the bottom of the page. The code behind this great example was... Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" I checked out the source of the ajax.js file and... Code: Event.observe(window, 'load', init, false); The greet() function then, after doing some housekeeping with posted(get..ed) content, used the magic Ajax.Updater, again well named, feature to send this information to the greeting.php file. It took me 2 minutes to track this example down and another 10 minutes to reply to this post. Isn't it amazing what you can do with, in my case, a PC, google, common sense and the internet! Cheers |