I got my desired output, but it is not best way of doing bcoz ajax is duplicating on every click.
Here is my code:
<a href="/messages/schedule" class="greenbtn fancybox">Schedule</a>
$('a.fancybox').click(function() {
$('a.fancybox').fancybox({
width : 600,
height : 300,
fitToView : false,
autoSize : false,
type : 'ajax',
ajax : { data : {'receiver_id' : $('#receiver_id').val(), 'subject' : $('#subject').val(), 'body': CKEDITOR.instances.body.getData()}}
});
});
First click fires one ajax request, second fires two and so on. How I can solve this?
I have also tried ready function intead of click, but ready function is not giving updated parameters which i am passing in ajax data option.