Hi,
I have a js file that makes an ajax call to php file.
In the php file I check the user session, and when its throws an exception, I want to present it nice like moodle does with the 'core/notification' module , but Its not working for me.
here is the js code:
$.post(cfg.wwwroot+'/ajax.php', params, function(){})
.done(function(data) {
data = JSON.parse(data);
console.log(data);
})
.fail(function(jqXHR, status, error){
notification.exception(jqXHR);
});
and this is the php function that throws the exception:
require_sesskey();
I whant something like this:
Thanks in advance,
Adi