i want to call base_url() in js file because i want to call ajax in jquery
its my php file
$.ajax({
url: '<?php echo site_url('home/update');?>',
data: {
email:email
},
type: "POST",
success: function(data) {
$('#feedback').text(data).css('color','green');
},
});
}
else
{
$('#feedback').text('insert a valid email').css('color','red');
}
});
but i want to call in js file but i am confused how can i fix this because we can't call tags in js file
dataattribute on the element which raises the event, then read it back in JS using$(this).data('foo');