Ajax request with prototype - what is transport if not only responseText?
Posted
by Delirium tremens
on Stack Overflow
See other posts from Stack Overflow
or by Delirium tremens
Published on 2009-06-24T10:09:46Z
Indexed on
2010/05/25
9:01 UTC
Read the original article
Hit count: 217
This is an example code from the prototype site.
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' });
}
});
The data that comes from the ajax request is available at transport.responseText, but what is transport if not only responseText?
© Stack Overflow or respective owner