Web page: function writeLog(someValue) { //write to appliction log now = new Date() url = 'http://somewhere/Logger.php?CMD='+someValue+'&now='+now new Ajax.Request(url, { method: 'get', evalScripts:true }); }
function writeComplete(someResponse) { alert(someResponse) } - - - Logger.php output: <script type="text/javascript"> writeComplete('MOO') </script> On Jul 4, 11:40 am, cdams <[EMAIL PROTECTED]> wrote: > What do you mean? > > Can you develop a little your solution? > > On 4 juil, 17:11, Diodeus <[EMAIL PROTECTED]> wrote: > > > I've always found it easier to use evalScripts:true in the Ajax call > > and spit back a script to call a function do do whatever I need. > > > On Jul 4, 10:20 am, cdams <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I looked into the web, and I find that this is a common error, but I > > > haven't any solution.. > > > > My method Ajax.Request is in another method. And for my function(v), I > > > need to put a return, false or true. > > > I tried with my script, but it doesn't work.. > > > > Have you any idea to solve my pb? > > > > Thanks > > > > My script : > > > > var valid = new Validation('form-extra', {immediate : true}); > > > var resultat = false; > > > > Validation.add( 'validate-captcha', 'Captcha is wrong!', function(v){ > > > new Ajax.Request( 'ajax_serve.php', { > > > method: 'get', > > > parameters: { > > > validate: v > > > }, > > > onSuccess: function( transport ) { > > > if( transport.responseText.match(/true/)) { > > > $('captcha').removeClassName('validation-failed'); > > > $('captcha').addClassName('validation-passed'); > > > resultat = true; > > > } else { > > > $('captcha').removeClassName('validation-passed'); > > > $('captcha').addClassName('validation-failed'); > > > resultat = false; > > > } > > > } > > > }); > > > return resultat; > > > > }); --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---