Re: prototype.js Ajax example?

Chris Roos
Mon, 25 Jul 2005 11:48:29 -0000

chuck Clark wrote:
> Thanks for the links Chris!
> I was more so looking for a pure prototype.js example, not with Rails
though.
> Is there a more specific group to ask about prototype.js ?  There is
> not much info
> out there about it, and the lack of documentation is making this
> difficult for me.
>
> Thanks,
> chuck
>
I''m not sure there is a prototype.js group to be honest.  I came across
these prototype.js docs [1] on cpan a few days back.  They may, or may
not, be of some use to you.

Have you got as far as updating a section of your page using ajax?  If
not, you might want to try this.

<a href="#" onclick="new
Ajax.Updater(''mydivhere'', ''myurlhere'',
{asynchronous:true, evalScripts:true}); return false;">Testing
Ajax

This will use ajax to call ''myurlhere'' and place the response
in the dom
element ''mydivhere''.

If you want to use ajax to submit the contents of a form, use the following.

<form action="myurlhere" method="post" onsubmit="new
Ajax.Updater(''mydiv'', ''myurlhere'',
{asynchronous:true, evalScripts:true,
parameters:Form.serialize(this)}); return false;">



Hope some of this helps,

Chris

[1] http://search.cpan.org/~sri/HTML-Prototype-1.30/lib/HTML/Prototype/Js.pm