Open Ajax window script


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
4 views
Hello!

There is a client site-one page Joomla! The problem with it is that all extra content (pages) open in a Ajax window and when switching to these opening pages with the search engines, they are shown in a simplified pattern. Now there is a challenge to when entering on such a page, the user is redirected to home page and open the material in the Ajax window. The mechanism of Windows is implemented using plugin RokBox (demo).

Links have the following form:
rel="rokbox[561 350]"
title="Audi RS8 :: Sample Caption for RS8">

All head already broke how to do it. I would be grateful for any tip on useful information.
by | 4 views

2 Answers

0 like 0 dislike
On the main page are passed on to all those links and add them to a parameter:
\r
$(function() { $('a[rel^="rokbox"]').each(function(){ if (this.href.indexOf('?') == -1) { this.href = this.href + '?ajax=1'; } else { this.href = this.href + '&ajax=1'; } }); }); 

On the server check if parameter is not ajax, then the page loaded by direct link and a redirect is needed.
by
0 like 0 dislike
Try to check the header X-Requested-With, you won't have to add a parameter in the URL. I think all the JS libraries now add it (standard?)
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Apr 21, 2019 by Lyuba2018
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
27,881 users