Hello qualiteam,
As you suggest about to use admin url i have done same but my issue is remain same. the code is as below :
PHP Code:
<script>
jQuery( document ).ready(function() {
var wkUrldds = self.location;
var wkUrl=wkUrldds+'skins/admin/modules/Webkulsoftware/WebPushNotification/notify.php';
jQuery('body').on('click','.notifybtn',function(){
var idss = jQuery(this).val();
var urll = jQuery('form').attr('action');
sendPushNotification(idss, urll);
});
function sendPushNotification(idss, urll){
jQuery.ajax({
url: urll+'?target=notif_tmplts&action=notify',
data: {id: idss,urll: urll},
type: 'POST',
success: function (data) {
if(data != ''){
console.log(data);
}else{
console.log('Not a valid data');
}
}
});
}
});
</script>
And the controller function is as below:
PHP Code:
protected function doActioNotify(){
$tpId = \XLite\Core\Request::getInstance()->nIds;
echo $tpId;
}
In that case the ajax call is done but when i click on the ajax url in console then it redirect on the page where a notice is appear that i have no permission to access that page. I have also provide the snapshot of that page below;