I have a problem with the Ajax.Updater function of prototype (1.5). I wrote the following function: function SendRequest() { var idCatalogo = $(''idCatalogo'').value; var idFormulario = ''formCatalogo'' + idCatalogo; var Formulario = $(idFormulario); var Accion = Formulario.action; alert(Accion); // It prints the correct action // ''http://localhost: 8080/cig/SaveInstance?catid=1''; var myAjax = new Ajax.Updater(''menu'',Accion,{method: ''get''}); } But Ajax.Updater is not making the ajax call. The console error doesn''t show any error. The server monitor (I am working with servlets in java) doesn''t register any request. I decided to try something, then when I put it in this way, putting directly the url in the var Accion, it works fine. ¿Am I doing something wrong? ¿Why it works fine when I write directly the url into the variable? function SendRequest() { var idCatalogo = $(''idCatalogo'').value; var idFormulario = ''formCatalogo'' + idCatalogo; var Formulario = $(idFormulario); var Accion = ''http://localhost:8080/cig/SaveInstance?catid=1''; var myAjax = new Ajax.Updater(''menu'',Accion,{method: ''get''}); } Thanks in advance for your 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 -~----------~----~----~----~------~----~------~--~---
Hey, Denis a écrit :> alert(Accion); // It prints the correct action // ''http://localhost: > 8080/cig/SaveInstance?catid=1''; > var myAjax = new Ajax.Updater(''menu'',Accion,{method: ''get''}); > } > But Ajax.Updater is not making the ajax call. The console error > doesn''t show any error. The server monitor (I am working with servlets > in java) doesn''t register any request.Is the page you''re calling this from on localhost:8080? S.O.P. mandates that AJAX calls do not cross hosts, and often requires they do not cross ports, either. -- 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 -~----------~----~----~----~------~----~------~--~---
This could be a cache problem, so you might try using a post instead of a get. I''ve run into a similar issue in the past, and it had to do with the browser (IE in my case) not making the call because it had a response to that request in its cache. Its my understanding that you can also fix it by sending the proper headers with the response, but I didn''t try that since what I was doing didn''t really need to be a get. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hey... var idCatalogo = $(''idCatalogo'').value; var idFormulario = ''formCatalogo'' + idCatalogo; or var idCatalogo = $(''idCatalogo'').value; var idFormulario = ''formCatalogo='' + idCatalogo; ? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---