How to disable nette.ajax.js redirect just for concrete link?

3 years ago

mcmatak
Member | 492
+
0
-

I have a list of products

http://www.onlinesekac.cz/…ke-bundy/c-7

and if you click on concrete product, then modal window open with the detail of product.

But also the page url is redirected, and i need to disable this behaviour for this link, just only for this link, bcs it is special case.

How to do it?

3 years ago

iguana007
Member | 988
+
0
-

Disable history – code snippet how to do that is mentioned here:
https://forum.nette.org/…ktere-odkazy

3 years ago

iguana007
Member | 988
+
0
-

And also one more thing, to make answer more accurate – page is not redirected in your case, the change of the URL has been done by Javascript without redirect – these changes of URL are done by already mentioned history plugin for nette.ajax.js, so that user could use browser`s back button when needed and application could respond to that.
Link for other forum topic mentioned above also describes you process how to enable history plugin only for some selected links/actions…

3 years ago

mcmatak
Member | 492
+
+1
-

perfect, thanks, the final solution is only this!

<a n:href="doIt!" class="ajax" data-ajax-off="history">Do it!</a>