[Javascript] prototype onSuccess questen

Nick Fitzsimons nick at nickfitz.co.uk
Fri Dec 21 04:35:12 CST 2007


onSuccess: function(transport) {
    foo(transport);
}

shoudl work.

Regards,

Nick.
--  
Nick Fitzsimons
http://www.nickfitz.co.uk/


On 21 Dec 2007, at 08:53, Michael Borchers wrote:

> Question about:
> http://www.prototypejs.org/api/ajax/request
> var url = '/proxy?url=' + encodeURIComponent('http://www.google.com/ 
> search?q=Prototype'); // notice the use of a proxy to circumvent  
> the Same Origin Policy. new Ajax.Request(url, { method: 'get',  
> onSuccess: function(transport) { var notice = $('notice'); if  
> (transport.responseText.match(/href="http:\/\/prototypejs.org/))  
> notice.update('Yeah! You are in the Top 10!').setStyle 
> ({ background: '#dfd' }); else notice.update('Damn! You are beyond  
> #10...').setStyle({ background: '#fdd' }); } });Can I also call a  
> defined function like foo()? function foo(){alert 
> (transport.responseText);} If so, how do I pass the "transport"? 
> onSuccess: function() { foo(transport) } won't work:( And  
> onSuccess: function(transport) { test() } does not seem to pass  
> "transport":/ Any ideas?!
>
>
> -- 
> MfG
> Michael Borchers
> Tridem GmbH
> http://www.tridem.de
> mailto: borchers at tridem.de
> Tel.: 0491 / 96 06 71 63
> ICQ: 322766923
> _______________________________________________
> Javascript mailing list
> Javascript at lists.evolt.org
> http://lists.evolt.org/mailman/listinfo/javascript




More information about the Javascript mailing list