I don''t see neither load nor render methods anywhere in Ajax. On the
other hand, prototype makes it easy to subclass Ajax.Base or
Ajax.Request. This would probably be the best thing to do in your
case.
- kangax
On Mar 11, 1:29 pm, campesr <camp...-YDxpq3io04c@public.gmane.org>
wrote:> Hi,
>
> I''ve got the following problem:
>
> I created this class, which helps me to make AJAX calls and process
> them. What I''d like to do is, to access the function
"render()" in
> "ajaxLoad" from the Ajax.Request in "load()".
I''ve tried via the
> "this" keyword, but of course "this" refers to
"Ajax" in this case. Is
> there a possibility to access the "render()" function somehow?
>
> var ajaxLoad = Class.create({
> initialize: function(url, request)
> {
> this.url = url;
> this.request = request;
> },
> load: function()
> {
> new Ajax.Request(this.url,
> {
> parameters: this.request,
> method: ''post'',
> encoding:
''utf-8'',
> onSuccess: function(response)
> {
> this.render(response);
> },
> onComplete: function()
> {
>
progressIndicator(''search-loading'', {status:
''close''});
> },
> onCreate: function()
> {
>
progressIndicator(''search-loading'', {status:
''load''});
> }
> });
> },
> render: function(response)
> {
> $(''iframe'').innerHTML =
response.responseText;
> }
> });
>
> Many thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---