Ajax.Updater syntax

new Ajax.Updater(window.opener.document.getElementById(‘facilityBookingFrm’), saveBookingUrl, {asynchronous:true, evalScripts:true, method:’POST’, onComplete:function(request, json){ setCalendar(‘\”+objDateS+\”‘);  setTargetDate(‘event2’, ‘\”+objDateS+\”‘ ); timeSlotsArray = new Array(); timeSlotsConflictArray = new Array();  thirdClick = false; clearBoxes(0); eval(‘\”+evalToScript+\”‘); Calendar.setup({ inputField : ‘start_date’, ifFormat : ‘%b, %d %Y’, button : ‘f_trigger_c’, align : ‘Tl’, position : positionArr,  singleClick : true }); Calendar.setup({ inputField : ‘end_date’, ifFormat : ‘%b, %d %Y’, button : ‘e_trigger_c’, align : ‘Tl’, position : positionEArr,  singleClick : true }); }, onLoading:function(request, json){}, parameters: { startDate: fab_starttime, selectedSlot: selectedSlot, repeatWeekly: fab_repeat_weekly, repeatWeekday: fab_repeat_weekday, repeat: fab_repeat, reminder_tim: fab_sendreminder_type, reminder_mins: fab_sendreminder_beforemins, fac_id: fac_id, endDate: fab_endtime, selectedConflictSlot: selectedConSlot, reConflicts: reConflicts, currdateStr: currdateStr, otherHVar: otherHVar, conflictResol: ‘1’ } });

The syntax goes as follows:

new Ajax.Updater ( ‘elementToBeUpdated’, ‘urlInRequest’, { asynchronous:true, evalScripts:true /* true or false*/, method: ‘POST’ /*’POSTorGET’*/, onComplete:function(request, json){ /*Action after completion of request */ } , onLoading:function(request, json){ /*Action while loading */ }, parameters: { /* post parameters to be passed*/ } } )

Advertisements