When making a call out to the yahoo web service (http://boss.yahooapis.com/ysearch) to return a data set, is it possible to set a timeout and exit the routine once its elapsed?
jQuery.getJSON("http://boss.yahooapis.com/ysearch/...etc",
function (data) {
//result set here
});
You can use the timeout option
http://api.jquery.com/jQuery.ajax/
The timeout option proposed by Galen is the best way. If you want an alternate method, you could record the time when the request was initiated and, in your callback, compare it to the current time. Ignore the result if a certain amount of time has elapsed. Of course this would not cancel the request.