Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

47 lines (37 sloc) 0.865 kB
#imgs img {
display: inline;
margin: 10px;
When fetching, the failure alert should only fire on script timeout. Also, onSuccess should not fire on timeout.
<button id="a">1000 ms timeout</button>
<button id="b">5000 ms timeout</button>
<div id="imgs"></div>
<script src="/depender/build?require=More/Request.JSONP,Core/Element.Event"></script>
$('a').addEvent('click', request.bind(this,1000));
$('b').addEvent('click', request.bind(this,5000));
function request(timeout){
new Request.JSONP({
log: true,
data: {
delay: 1
timeout: timeout,
url: '/echo/jsonp',
onFailure: function(){
alert("this request failed");
onTimeout: function(){
alert("this request timedout");
onSuccess: function(data){
alert('this request completed successfully');
Jump to Line
Something went wrong with that request. Please try again.