Plugin: MX Ajax Detect (EE 1.6x / EE 2.x )
Posted: 24 January 2009 09:20 AM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  353
Joined  01-04-2008

MX Ajax Detect is a small and simple plugin detect is template was request by AJAX or not. For example, you create a website where all links opens in modal windows by ajax. But what happened if user turned off his javascript? The better to bee sure that user will see a full page not only simple block for modal windows. One of way is to use Ajax Detect plugin.

Download & Documentation

 Signature 

my EE2 addons| Support forum | my EE1 addons
Like my addons? Follow me: @eecms @max_lazar

Profile
 
 
Posted: 24 January 2009 09:38 AM   [ Ignore ]   [ # 1 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  13725
Joined  04-15-2006

Hiya,

Don’t suppose you could explain to the Ajax illiterate (read me wink ) exactly what we (read me again wink ) can do with this plugin. Sounds interesting but unfortunately my Ajax skills are definitely not where I would like them to be at the moment so any pointers on the plugin and what it can do would be great for me, thanks.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin | Full List Of Add-Ons | About Me
——————————————————————————————
2.x Bug Tracker | Upgrade Errors

Profile
 
 
Posted: 24 August 2009 04:51 AM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  353
Joined  01-04-2008

Update description and Documentation

 Signature 

my EE2 addons| Support forum | my EE1 addons
Like my addons? Follow me: @eecms @max_lazar

Profile
 
 
Posted: 11 September 2009 08:06 PM   [ Ignore ]   [ # 3 ]  
Lab Assistant
RankRank
Total Posts:  191
Joined  01-20-2006

This is fantastic, exactly what I need for a project I’m working on. I’m going to test it right now. Thanks a lot.

Edit: tested and highly recommended!

 Signature 

buro taggetig: freelance web design from Belgium.  |  Follow me on Twitter

Profile
 
 
Posted: 23 September 2009 04:32 PM   [ Ignore ]   [ # 4 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  13725
Joined  04-15-2006

Hi Max,

Just wanted to say that I had a need for this plugin just today and now that I understand what it’s for I can definitely go on record as saying it’s really great grin

Nice, simple plugin but really helps with what I’m doing for a UI that I’ve AJAXified.

Thanks for releasing this one for us to work with.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin | Full List Of Add-Ons | About Me
——————————————————————————————
2.x Bug Tracker | Upgrade Errors

Profile
 
 
Posted: 15 December 2009 05:16 PM   [ Ignore ]   [ # 5 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  353
Joined  01-04-2008

Release v2.1 - compatible with EE 2.x.

 Signature 

my EE2 addons| Support forum | my EE1 addons
Like my addons? Follow me: @eecms @max_lazar

Profile
 
 
Posted: 15 December 2009 05:16 PM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  353
Joined  01-04-2008

Double post :(

 Signature 

my EE2 addons| Support forum | my EE1 addons
Like my addons? Follow me: @eecms @max_lazar

Profile
 
 
Posted: 27 January 2010 08:34 AM   [ Ignore ]   [ # 7 ]  
Summer Student
Total Posts:  21
Joined  05-13-2004

Hello Max,


Uploaded it in system/expressionengine/plugins on a EE 2.0.1 install.

It doesn’t appear in the CP.

Any help ?

Profile
 
 
Posted: 27 January 2010 08:59 AM   [ Ignore ]   [ # 8 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  353
Joined  01-04-2008

sorry, I don’t update the doc’s for v2 yet - in v2 all third_party addons must be copy to system\expressionengine\third_party\

 Signature 

my EE2 addons| Support forum | my EE1 addons
Like my addons? Follow me: @eecms @max_lazar

Profile
 
 
Posted: 08 February 2010 10:24 AM   [ Ignore ]   [ # 9 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  122
Joined  08-07-2008

Hm, i’m to stupid for it?

On my homepage i load some stuff in jquery overlays. But i want people who have turned of JS to see the content. So i need a link for the overlay and another one to another template.

{exp:ajax_detect}
{if ajax}
<a href="{url_title_path='group/template-overlay'}" rel="#sum"><img src="{product_featured_image}" width="150" height="100" class="float-left" alt="Thumb" /></a>
{if:else}
<a href="{url_title_path='group/template-nooverlay'}"><img src="{product_featured_image}" width="150" height="100" class="float-left" alt="Thumb" /></a>
{/if}
{
/exp:ajax_detect} 

It doesnt matter if i have JS on or off, i allways get the template-nooverlay path…

Profile
 
 
Posted: 08 February 2010 10:39 AM   [ Ignore ]   [ # 10 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  353
Joined  01-04-2008

? could you please specify - you put this code

{exp:ajax_detect parse="inward"}
{if ajax}
Here we embedded
(or just insertshort images layout
{if
:else}
Here we embedded
(or just insertpage with full images page layout
{
/if}
{
/exp:ajax_detect} 

to page witch upload by ajax(for example, displayed in modal windows), correct ?
And in modal windows and by using direct link you see the same information?
(if you website online – could you please send me url to PM)

p.s. (I add parse=“inward” because in your case it will be better to parsing tags this way)

 Signature 

my EE2 addons| Support forum | my EE1 addons
Like my addons? Follow me: @eecms @max_lazar

Profile
 
 
Posted: 08 February 2010 11:59 AM   [ Ignore ]   [ # 11 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  122
Joined  08-07-2008

No the code is not in the ajax overlay its on my homepage (group/index.html)

I have a template (group/template1.html) this is the side that i want the user to see if javascript is off.

<a href="{url_title_path='group/template1.html'}">normal link</a

Then i have a template that is just blank content (no header, sidebar and so on). This template i want to load in an overlay(lightbox).

<a href="{url_title_path='group/template2.html'}">normal link</a

So what i need is that the user with javascript on gets the link to overlay.html on the homepage.

You can read more about my problem here http://www.sitepoint.com/forums/showthread.php?t=659677
I thought MX Ajax Detect is the solution grin

Profile
 
 
Posted: 08 February 2010 01:25 PM   [ Ignore ]   [ # 12 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  353
Joined  01-04-2008

yes, MX Ajax Detect is possible your solution, but you need to thinking the different way - this plugin helps your to display the same template/page with different content base on request type. If you request it by JS - you will see content between {if ajax}{if:else}, if user don’t have ajax, he just go to the page and will see content between {if:else} {/if}
try to create template with this code bellow and used it with for you $(“a[rel]”).overlay({...)}  (with JS enable/disable):

{exp:ajax_detect parse="inward"}
{if ajax}
Here we embedded
(or just insertshort images layout
{if
:else}
Here we embedded
(or just insertpage with full images page layout
{
/if}
{
/exp:ajax_detect} 
 Signature 

my EE2 addons| Support forum | my EE1 addons
Like my addons? Follow me: @eecms @max_lazar

Profile
 
 
Posted: 09 February 2010 08:40 PM   [ Ignore ]   [ # 13 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  122
Joined  08-07-2008

Ok, it works. Now i know how and its a great way, cause there is just one link needed.
What is parse=“inward” for?


Ok, this works for modal windows, overlays, lightboxes or however people call it grin.
Now i was on my way to build the categories page and did it the same way.
BUT, it doesn’t work. Hm, then i had the enlightenment. The page is not a modal and is called via a normal link.

Ok, I know there is no save way to check if somebody has JS on. And i saw you to it via
the XMLHttpRequest. Here is my idea:

Can we (you) make a parameter that we can put in the url that checks the XMLHttpRequest like it is Ajax even its not? A fake ajax/jquery link grin.
Something like:

<a href="{path=" ajax="1">Link</a

Or maybee it can be done with jQuery and a class in the link. Like:

<a href="{path=" class="jcheck">Link</a

Sorry im really not a php or JS guy :-(

Profile