Skip to content

Instantly share code, notes, and snippets.

View robinjfisher's full-sized avatar

Robin Fisher robinjfisher

View GitHub Profile
function grabBookings(date) {
$$(".booking").each(function(b) {
b.remove();
});
if (!$('ajax-loader')) {
$('bookings').insert("<img src='/images/ajax-loader.gif' id='ajax-loader' />");
}
new Ajax.Request(date.readAttribute("href"), {method:"get", evalJS:true, onSuccess:function(transport) {
var bookings = transport.responseJSON;
$('ajax-loader').remove();
if($("plane_airport_id")) {
new Form.Element.Observer('plane_airport_id', 0.1, function(event) {
var string = $F('plane_airport_id');
if (string.length >= 3) {
new Ajax.Request('/airports', {method:'get',parameters:{search:string},
onSuccess: function(transport) {
var airports = transport.responseJSON;
var lis = $('airport-list').descendants();
if (lis.length > 0) {
lis.each(function(l) {