Hello,
Many thanks for nice post. It was really easy to simulate your problem. But not so easy to solve it.
Finally there is no syntax error. Only IE and Safari browsers are trying to make a joke. But it is really not funny!
Try to modify the file: components/com_booking/assets/js/calendars.js - function requestNavigation
/**
* Calendar pagination via ajax
*/
requestNavigation : function() {
new Request({
url: location.href,
method: 'post',
data: $(Calendars.getForm()).toQueryString() + '&tmpl=component&ajax=1',
onRequest: function() {},
onSuccess: function(responseText) {
var beginMark = '<!-- Calendar HTML Begin -->'; // sign in html where changed content begins
var endMark = '<!-- Calendar HTML End -->'; // sign in html where changed content ends
var beginIndex = responseText.indexOf(beginMark); // changed content begin index
var endIndex = responseText.indexOf(endMark); // changed content end index
var length = endIndex - beginIndex + endMark.length; // changed content length
var html = responseText.substr(beginIndex, length); // parse changed content
$('bookingCalendar').set('html', html); // update current page
var beginMark = '<!-- Calendar JS Begin -->';
var endMark = '<!-- Calendar JS End -->';
var beginIndex = responseText.indexOf(beginMark);
var endIndex = responseText.indexOf(endMark);
var start = beginIndex + beginMark.length;
var length = endIndex - beginIndex;
var js = responseText.substr(start, length);
var script = document.createElement('script');
script.setAttribute('type', 'text/javascript');
Calendars.boxes = new Array();
script.text = js;
$('bookingCalendar').appendChild(script);
Calendars.init(Calendars.multi);
},
onFailure: function() {}
}).send();
},
The most of the code is still same as before.
Tested on IE7 - 10, Safari, Google Chrome and Mozilla Firefox.
Please, also replace function showTotal in same file
/**
* Send whole reservation form to the server through AJAX to ge total price.
*/
showTotal : function() {
var form = $(this.getForm()).clone(); // copy of reservation form
// remove navigation parameters
$(form.task).dispose();
$(form.controller).dispose();
$(form.Itemid).dispose();
new Request({
url: juri + 'index.php?option=com_booking&controller=reservation&task=gettotal',
method: 'post',
data: $(form).toQueryString(),
onSuccess: function(responseText) {
responseText = JSON.decode(responseText);
if (responseText['status'] == 'FAIL') {
Calendars.unBookAbleInterval = true;
if (responseText['error'] != '') {
$('total').set('html', '<span class="unBookAbleInterval">' + responseText['error'] + '</span>');
} else {
$('total').set('html', '<span class="unBookAbleInterval">' + LGUnBookAbleInterval + '</span>');
}
} else if(responseText['status'] == 'OK') {
Calendars.unBookAbleInterval = false;
$('total').set('html', responseText['total'] == '' ? ' ' : responseText['total']); // show total price on page
}
}
}).send();
},
There was removed only comma ',' before this row: '}).send();'. It is repair for IE7.