Hey everyone, I need some advice in how to get IE to update a div properly within an ajax call. The problem is that the onLoading function call inserts "Loading.." into the div. When the call is successfully completed, the Loading message should be replaced by the responseText. This works in firefox with no problems. However in IE, the Loading message is not always replaced. The error appears to be random. Any advice you could give would be really appreciated! The ajax call I use is: var objAjax = new Ajax.Request ( url, { method: ''post'', postBody: params, evalScripts: true, onLoading: function() { $(div).update("<p>Loading ...</p>"); }, onSuccess: function(request) { while( $(div).firstChild ) $(div).removeChild($(div).firstChild); $(div).update(request.responseText); }, onFailure: function(request) { $(div).innerHTML = "<h3>Error:</h3>" + request.status; } } ); } --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
you could use innerHTML property $(div).innerHTML("<p>Loading ...</p>"); and if the response is html formated then: $(div).innerHTML(request.responseText); I know it''s not a standard method but it is a possibility :) cheers on 11/8/2006 10:58 PM rjonasz said the following:> Hey everyone, > > I need some advice in how to get IE to update a div properly within an > ajax call. The problem is that the onLoading function call inserts > "Loading.." into the div. When the call is successfully completed, the > Loading message should be replaced by the responseText. This works in > firefox with no problems. However in IE, the Loading message is not > always replaced. The error appears to be random. Any advice you could > give would be really appreciated! The ajax call I use is: > > var objAjax = new Ajax.Request ( > url, > { > method: ''post'', > postBody: params, > evalScripts: true, > onLoading: function() { > $(div).update("<p>Loading ...</p>"); > }, > onSuccess: function(request) { > while( $(div).firstChild ) > $(div).removeChild($(div).firstChild); > > $(div).update(request.responseText); > }, > onFailure: function(request) { > $(div).innerHTML = "<h3>Error:</h3>" + request.status; > } > } > > ); > } >-- Abdulrahman Al-Otaiba --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 11/8/06, Abdulrahman Al-Otaiba <php.ajax-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > you could use innerHTML property > > $(div).innerHTML("<p>Loading ...</p>"); > and if the response is html formated then: > $(div).innerHTML(request.responseText);Alas, I tried innerHTML with the same result: random changes to div -- Imagine no possessions I wonder if you can No need for greed or hunger A brotherhood of man Imagine all the people Sharing all the world --John Lennon --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---