macfurax
2007-Mar-02 11:09 UTC
Ajax.Request don''t work any more when update prototype from 1.4 to 1.5
Hello, I was wokring on an admin programme using HTML and Ajax and Prototyp. When I update Prototype from 1.4 to 1.5 nothing works anymore. No request leave my browser (no log of of HTTPRequest in the Firebug consol) no error message nothing ! I got crasy ... Event sample code from Prototype doc doesn''t work. The code sample bellow work fine with version 1.4 but not with 1.5. var handlerFunc = function(t) { alert( t.responseText ); } var errFunc = function(t) { alert(''Error '' + t.status + '' -- '' + t.statusText); } new Ajax.Request(''./remote.php'', {parameters:''action=listBlob'', onSuccess:handlerFunc, onFailure:errFunc}); The remote.php is working fine I test it appart. Did I miss something .. Im'' working on a Windows XP SP2 computer with Firefox 2.0.0.2. and XAMPP Apache/MySQL/PHP. Thanks Constant --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2007-Mar-02 11:17 UTC
Re: Ajax.Request don''t work any more when update prototype from 1.4 to 1.5
Hey there, macfurax a écrit :> When I update Prototype from 1.4 to 1.5 nothing works anymore.Do you by any change use json.js or another library (e.g. Rico) that extends Object.prototype? If so, that''s your issue, as 1.5.0''s version of header management for AJAX requests uses a for...in loop, which will stumble on Object.prototype extensions. Which is why extending Object.prototype is, er, *evil* :-) Search this group''s archives for many possible solutions, until 1.5.1 comes out :-) -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
macfurax
2007-Mar-02 11:23 UTC
Re: Ajax.Request don''t work any more when update prototype from 1.4 to 1.5
Hi, You are wright I use json.js ! I will look in the group posts or continue with version 1.4. Thanks Constant On 2 mar, 12:17, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> Hey there, > > macfurax a écrit : > > > When I update Prototype from 1.4 to 1.5 nothing works anymore. > > Do you by any change use json.js or another library (e.g. Rico) that > extends Object.prototype? If so, that''s your issue, as 1.5.0''s version > of header management for AJAX requests uses a for...in loop, which will > stumble on Object.prototype extensions. > > Which is why extending Object.prototype is, er, *evil* :-) > > Search this group''s archives for many possible solutions, until 1.5.1 > comes out :-) > > -- > Christophe Porteneuve aka TDD > t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Vlad
2007-Mar-02 11:42 UTC
Re: Ajax.Request don''t work any more when update prototype from 1.4 to 1.5
I''ve got a similar problem, when after upgrading to 1.5.0 from 1.4.0 a synchronous request stopped working: var desc = new Array(); desc.Load = function () { var myAjax = new Ajax.Request(''description.txt'', { method: ''get'', asynchronous: false} ); var values=myAjax.transport.responseText.split(''|''); while (values.length) this.push(values.shift()); myAjax=null; } It stumbles on the next line after the new Ajax.Request, saying that data isn''t yet available. Couldn''t find a solution. Using asynchronous requests doesn''t make sense, since it''s an initialisation function and a user has to wait anyway. Any ideas? Thanks! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Vlad
2007-Mar-02 11:52 UTC
Re: Ajax.Request don''t work any more when update prototype from 1.4 to 1.5
In addition, I am not using json.js or pico, however add couple of things via prototype to standard JS objects, like: String.prototype.trim = function () {return this.replace(/^\s*|\s* $/,"");} Removing them doesn''t help. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2007-Mar-02 13:03 UTC
Re: Ajax.Request don''t work any more when update prototype from 1.4 to 1.5
Hey Vlad, Vlad a écrit :> String.prototype.trim = function () {return this.replace(/^\s*|\s* > $/,"");}It''s not specific prototypes you have to be worried about, it''s Object.prototype, specifically. Either in your own code, or in the code of libraries you use. -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Vlad
2007-Mar-06 09:39 UTC
Re: Ajax.Request don''t work any more when update prototype from 1.4 to 1.5
Christophe, thank you. I am not using Object.prototype. However after some testing things finally cleared up: After switching to 1.5.0 the script stopped working within IE 7.0 when loaded from HDD (even after I «ok» the IE security messsage). Once I uploaded the script to www it started working just fine. Some of the 1.5.0 changes apparentely broke Ajax.Request behaviour in the offline mode. Vlad --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---