Nathan Tran
2006-Feb-21 04:31 UTC
RE: [Prototype] onSuccess Event and, Ajax.Updater bug in IE
Joe, After removing all occurrences of charset=utf-8 from my headers I am still getting the same bug in IE. Currently, it''s Content-Type: text/html Any other suggestion? Nathan.> Message: 2 > Date: Mon, 20 Feb 2006 09:13:57 -0500 > From: "Joe Hudson" <joe-x8g0hQFNjJhWk0Htik3J/w@public.gmane.org> > Subject: RE: [Rails-spinoffs] [Prototype] onSuccessEvent and> Ajax.Updater bugin IE > To: <rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> > Message-ID:<20060220141403.6ECA539A67-hapML+lR5zQf0INCOvqR/pqQE7yCjDx5@public.gmane.org>> Content-Type: text/plain; charset="us-ascii" > > I''m very new here so I might be leading you in thewrong direction but I had> a similar problem and after days of research, Ifinally found the answer.> > Look at the response headers. If the content typeheader contains> ;charset={encoding} there seems to be a problem withIE. Try removing this.> Keep the content type... just remove the charset. > > Joe > > -----Original Message----- > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >[mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Nathan> Tran > Sent: Monday, February 20, 2006 12:43 AM > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: [Rails-spinoffs] [Prototype] onSuccessEvent and Ajax.Updater bugin> IE > > Hi all, > > Is there a known bug with Ajax.Updater not workingin> IE6? I''m having > trouble with a Autocompleter control that calls a > function that contains > an Ajax.Updater as an AfterUpdateElement callback.It> works fine in > firefox, but I don''t think Ajax.Updater gets called > under IE. > > http://pastebin.com/563889 > > 1. > function updater(input, item) { > 2. > var item_data > item.getElementsByTagName(''span'')[0]; > 3. > var pars = ''item-data='' + > item_data.innerHTML + ''&input-text='' > + input.value; > 4. > new > Ajax.Updater(''nutrients'',''fooddb/browser/nutrients'', > {method : ''get'', parameters : pars, onFailure: > reportError, > onComplete: reportComplete, onSuccess: > reportSuccess}); > 5. > } > 6. > function > reportError(request) > 7. > { > 8. > > alert(''Sorry. There was an > error.''); > 9. > } > 10. > function > reportComplete(request) > 11. > { > 12. > > alert(''onComplete: '' + > request.responseText); > 13. > } > 14. > function > reportSuccess(request) > 15. > { > 16. > > alert(''onSuccess: '' + > request.responseText); > 17. > } > > > > If you look at that code, some how the response isnot> being inserted > into the ''nutrients'' div by the updater. Under IEthe> onComplete event > doesn''t fire. However, the request.responseText in > reportSuccess() > contains the correct html response from the server. > > Nathan. > >__________________________________________________________ Find your next car at http://autos.yahoo.ca
Joe Hudson
2006-Feb-21 14:36 UTC
RE: [Prototype] onSuccess Event and, Ajax.Updater bug in IE
Hi Nathan,
I''m pretty sure that you need to set the content type to
"text/javascript".
If you look at prototype.js the Ajax.Request respondToReadyState has a
content type check:
if ((this.header(''Content-type'') ||
'''').match(/^text\/javascript/i))
this.evalResponse();
Good luck.
Joe
> -----Original Message-----
> From:
rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
[mailto:rails-spinoffs-
> bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of
Nathan Tran
> Sent: Monday, February 20, 2006 11:32 PM
> To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> Subject: RE: [Rails-spinoffs] [Prototype] onSuccess Event and,Ajax.Updater
> bug in IE
>
> Joe,
>
> After removing all occurrences of charset=utf-8 from
> my headers I am
> still getting the same bug in IE.
> Currently, it''s Content-Type: text/html
> Any other suggestion?
>
> Nathan.
> > Message: 2
> > Date: Mon, 20 Feb 2006 09:13:57 -0500
> > From: "Joe Hudson"
<joe-x8g0hQFNjJhWk0Htik3J/w@public.gmane.org>
> > Subject: RE: [Rails-spinoffs] [Prototype] onSuccess
> Event and
> > Ajax.Updater bugin IE
> > To:
<rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org>
> > Message-ID:
>
<20060220141403.6ECA539A67-hapML+lR5zQf0INCOvqR/pqQE7yCjDx5@public.gmane.org>
> > Content-Type: text/plain; charset="us-ascii"
> >
> > I''m very new here so I might be leading you in the
> wrong direction but I had
> > a similar problem and after days of research, I
> finally found the answer.
> >
> > Look at the response headers. If the content type
> header contains
> > ;charset={encoding} there seems to be a problem with
> IE. Try removing this.
> > Keep the content type... just remove the charset.
> >
> > Joe
> >
> > -----Original Message-----
> > From:
rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> >
>
[mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]
> On Behalf Of Nathan
> > Tran
> > Sent: Monday, February 20, 2006 12:43 AM
> > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> > Subject: [Rails-spinoffs] [Prototype] onSuccess
> Event and Ajax.Updater bugin
> > IE
> >
> > Hi all,
> >
> > Is there a known bug with Ajax.Updater not working
> in
> > IE6? I''m having
> > trouble with a Autocompleter control that calls a
> > function that contains
> > an Ajax.Updater as an AfterUpdateElement callback.
> It
> > works fine in
> > firefox, but I don''t think Ajax.Updater gets called
> > under IE.
> >
> > http://pastebin.com/563889
> >
> > 1.
> > function updater(input, item) {
> > 2.
> > var item_data > >
item.getElementsByTagName(''span'')[0];
> > 3.
> > var pars = ''item-data='' +
> > item_data.innerHTML + ''&input-text=''
> > + input.value;
> > 4.
> > new
> >
Ajax.Updater(''nutrients'',''fooddb/browser/nutrients'',
> > {method : ''get'', parameters : pars, onFailure:
> > reportError,
> > onComplete: reportComplete, onSuccess:
> > reportSuccess});
> > 5.
> > }
> > 6.
> > function
> > reportError(request)
> > 7.
> > {
> > 8.
> >
> > alert(''Sorry. There was an
> > error.'');
> > 9.
> > }
> > 10.
> > function
> > reportComplete(request)
> > 11.
> > {
> > 12.
> >
> > alert(''onComplete: '' +
> > request.responseText);
> > 13.
> > }
> > 14.
> > function
> > reportSuccess(request)
> > 15.
> > {
> > 16.
> >
> > alert(''onSuccess: '' +
> > request.responseText);
> > 17.
> > }
> >
> >
> >
> > If you look at that code, some how the response is
> not
> > being inserted
> > into the ''nutrients'' div by the updater. Under IE
> the
> > onComplete event
> > doesn''t fire. However, the request.responseText in
> > reportSuccess()
> > contains the correct html response from the server.
> >
> > Nathan.
> >
> >
>
>
>
>
>
>
>
> __________________________________________________________
> Find your next car at http://autos.yahoo.ca
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
Apparently Analagous Threads
- [Prototype] onSuccess Event and Ajax.Updater bug in IE
- Ajax.Request synchronization (onSuccess before onComplete?)
- onSuccess and onComplete Prototype callbacks
- Prototype Ajax.Request (onLoading and onSuccess) question
- link_to_remote option :onsuccess, execute js function