Call server side function before opening startLightbox

Hello,
I am opening light custom div box, but before I call scheduler.startLightbox(… method I would like to call server side function to retrive some value. How can I call any server side method in onclick function?
scheduler.attachEvent(“onClick”, function (id, e) {

Thanks

I did something like this by overriding the lightbox function

scheduler.showLightbox = function(id) {
	// Get add_booking_form object
	var add_booking_form = document.getElementById('add_booking_form');       

	// Get the event object from id
	var ev = scheduler.getEvent(id);
	
	// Do you serverside stuff here, e.g. a GET request to fetch some json
	$.getJSON('http://www.donuts.com', function(data) {
		// Success callback
		
                // Do something with data

		// Init the lightbox
		scheduler.startLightbox(id, add_booking_form);
	})
}

Thank you!