rlg1200-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-10 01:17 UTC
trouble with ajax.request in IE6
Hi, I''m having trouble trying to use Ajax.Request with IE6. It seems to work fine in all other browsers I tested. The problem I''m having is that the onSuccess block seems to run BEFORE the onLoading block. I''m sure I''m doing something simple and blatantly wrong, so if someone could just point me in the right direction, I''d greatly appreciate it! Here''s the function: function rotateImage(direction) { var ajax = new Ajax.Request( rotateUrlPrefix + ".ajax", { method : "get", parameters : "id="+$ (''entryContainer'').getAttribute(''entryId'')+"&rand="+Math.random(), onLoading : function(ajaxRequest) { alert(''begin onLoading''); getEntryProperties(entry); alert(''end onLoading''); }, onSuccess : function(ajaxRequest) { alert(''begin onSuccess''); var entry = eval(''(''+ajaxRequest.responseText+'')''); setEntry(entry, direction); alert(''end onSuccess''); } }); --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
rlg1200-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-12 19:44 UTC
trouble with ajax.request in IE6
Can someone PLEASE help me, I''m really stuck hecre. Even if it''s just pointing me to a site or FAQ that would help me, I can figure it out from there. Thanks in advance! I''m having trouble trying to use Ajax.Request with IE6. It seems to work fine in all other browsers I tested. The problem I''m having is that the onSuccess block seems to run BEFORE the onLoading block. I''m sure I''m doing something simple and blatantly wrong, so if someone could just point me in the right direction, I''d greatly appreciate it! Here''s the function: function rotateImage(direction) { var ajax = new Ajax.Request( rotateUrlPrefix + ".ajax", { method : "get", parameters : "id="+$ (''entryContainer'').getAttribute(''entryId'')+"&rand="+Math.random(), onLoading : function(ajaxRequest) { alert(''begin onLoading''); getEntryProperties(entry); alert(''end onLoading''); }, onSuccess : function(ajaxRequest) { alert(''begin onSuccess''); var entry = eval(''(''+ajaxRequest.responseText+'')''); setEntry(entry, direction); alert(''end onSuccess''); } }); --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Can you put up a link to a minimalistic live demo? I have a feeling that there is something else causing your problem. I don''t see anything wrong with what you posted but there is a lot going on that isn''t there. Colin rlg1200-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> Can someone PLEASE help me, I''m really stuck hecre. Even if it''s just > pointing me to a site or FAQ that would help me, I can figure it out > from there. Thanks in advance! > > I''m having trouble trying to use Ajax.Request with IE6. It seems > to work fine in all other browsers I tested. The problem I''m having is > that the onSuccess block seems to run BEFORE the onLoading block. I''m > sure I''m doing something simple and blatantly wrong, so if someone > could just point me in the right direction, I''d greatly appreciate it! > > Here''s the function: > > function rotateImage(direction) { > var ajax = new Ajax.Request( > rotateUrlPrefix + ".ajax", { > method : "get", > parameters : "id="+$ > (''entryContainer'').getAttribute(''entryId'')+"&rand="+Math.random(), > onLoading : function(ajaxRequest) { > alert(''begin onLoading''); > getEntryProperties(entry); > alert(''end onLoading''); > }, > onSuccess : function(ajaxRequest) { > alert(''begin onSuccess''); > var entry = eval(''(''+ajaxRequest.responseText+'')''); > setEntry(entry, direction); > alert(''end onSuccess''); > } > }); > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
rlg1200-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-13 18:40 UTC
Re: trouble with ajax.request in IE6
OK, I figured out the problem. In the ''onLoading'' event, I called a function which in turn used window.setTimeout() like this: window.setTimeout(myFunction, 2000, arg); This seemed to work OK for all browsers except IE6. I changed it to the following, and now IE6 works, too: window.setTimeout(function () { myFunction(arg) }, 2000); Thanks, just knowing that the ajax request looked correct on first glance was help enough. --rich --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---