Custom ajax request with overlay-on-ajax extension

Notice: This thread is very old.
Member | 161

Hi guys,

I`m using this extension:…6b705023c0a4

At the beginning is this part:

$.nette.ext('overlay-on-ajax', {
		before: function (xhr, settings) {

			if (!settings.nette || !settings.nette.el) {

when I have <a class="ajax"..> and checked the settings parameters, it contains settings.nette and settings.nette.el.

I want to send custom ajax request, like:

$(document).on('click', 'a[data-parameter]', function (event) {

			url: url,
			data: data,
		}, this, event); // <-- problem

When I add that third event parameter, ajax request is cancelled.

What should I do to process ajax request and catch 'a[data-parameter]' at overlay-on-ajax extension?

If I remove event parameter at my custom $.nette.ajax, ajax is successful, but settings.nette is undefined.

Everything what I want is to have an access to a[data-parameter] at overlay-on-ajax extension :)

Thanks a lot!


Last edited by wise (2015-12-15 17:28)

Member | 22

Hi wise,

At first look you may have an error because using e.preventDefault();
Try event.preventDefault(); because “e” is undefined.