Good Morning!
i was working with jquery 1.3.2 and jQuery UI 1.7.3 and changed the version to jquery 1.4.2 and jQuery UI 1.8rc3. Before these versions of jquery this code worked perfect, now with new version it does not work and i could not find the problem.
Help please!
function createBookingModal(module, options) {
$("#bookingModal").dialog( {
dialogClass: 'alert',
autoOpen: false,
modal: true,
resizable: true,
bgiframe: true,
show: 'slide',
minWidth: 500,
minHeight: 400,
width: 750,
height: 400,
open:function() {
$(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar-close").remove();
}
});
$(this).find(".openBookingModal").live('click', function() {
if(options != undefined && options.validate != undefined && !options.validate(this)){
return false;
}
var parts = $(this).attr('id').split('_');
var id = parts[1] ? parts[1] : '';
var parameters = '';
if (options != undefined && options.extraParameters != undefined) {
parameters = options.extraParameters(this);
}
parameters = '?id=' + id + "&" +parameters;
if (options != undefined && options.serverValidation != undefined) {
options.serverValidation(this, function() {
openModal(module, parameters);
});
} else {
openModal(module, parameters);
}
});
$(this).find("a.newTrip").live('click', function() {
addEvent(module);
});
$(this).find("a.linkTrip").live('click', function() {
addEvent(module, $(this).attr('id'));
});
$(this).find("a.noBooking").live('click', function() {
$("#bookingModal").dialog('close');
});
}
function openModal(module, parameters) {
$("#bookingModal").load("/" + module + "/askBooking/" + parameters).dialog('open');
}
function addEvent(module, tripId) {
$(".ui-dialog").slideUp('slow', function(){
$.blockUI({ overlayCSS: { backgroundColor: '#00f' } });
});
var fbStories = $("#facebookStoriesCheckbox:checked").val();
var bookingId = $('#bookingId').val();
var safeTripId = tripId !== undefined ? tripId : '';
$.ajax({
url: "/" + module + "/linkTrip",
data: { id: bookingId, tripId: safeTripId, fbStories: fbStories },
dataType: 'json',
success: function(data) {
if(data.publish == 'on'){
location.href = '/profile/publish/'+data.type+'/'+data.id+'/'+data.trip_id;
} else {
location.href = '/profile/'+data.trip_id;
}
}
});
}
posible bug in $(this).find('.class').live('click', function() {}')., if change $(this).find for $('.class') worked. i use mozilla firefox 3.6 browser.