You can do as soeme thing as below
$('a').bind('click',function(){
var url = ($(this).attr('href'));
var cat = getURLParameter(url, 'cat');
var typ = getURLParameter(url, 'typ');
//calling the ajax function
pop(cat, typ)
});
function getURLParameter(url, name) {
return (RegExp(name + '=' + '(.+?)(&|$)').exec(url)||[,null])[1];
}
function pop(cat, typ) {
$.ajax({
type:'post',
url:site_url()+'/event/deleteEventSingle',
data:{'cat':cat,'type':typ},
async:false,
success:function(result){}
});
}
Check out the the example at Live fiddle http://jsfiddle.net/mayooresan/aY9vy/