Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-11-13 07:00:05

jamiew
Archived Plugin Author
From: NYC
Registered: 2005-01-08
Posts: 74
Website

[archived] dub_if_ajax -- was this page loaded directly or via JS?

Notice: This thread is archived, the plugin is no longer available.

**********************************************************

Simple plugin to check for headers signaling the page was loaded via AJAX. Have single articles coexist happily with dumbed-down, AJAX friendly versions.

> Information
> Demo
> Download link

Offline

#2 2007-09-04 11:57:29

instantok
Member
Registered: 2004-08-10
Posts: 20

Re: [archived] dub_if_ajax -- was this page loaded directly or via JS?

So it’s been a long time since this was first posted but I have a question. This plugin works great with MooTools AJAX but I’ve run into a problem if an article is accessible from two points, one via AJAX and the other through a normal page request. It seems the HTTP_X_REQUESTED_WITH header gets cached somewhere so if the page was first requested via AJAX, then later requested through a non-AJAX link, the page is rendered as if it was requested with AJAX instead of a normal page load. If the user visits the non-AJAX version first followed by the AJAX version the AJAX request loads the non-AJAX page.

Hopefully that all makes sense. Am I doing something wrong or is there a way to prevent the header from caching?

Last edited by instantok (2007-09-04 12:38:53)

Offline

#3 2007-09-25 12:34:40

instantok
Member
Registered: 2004-08-10
Posts: 20

Re: [archived] dub_if_ajax -- was this page loaded directly or via JS?

Fixed the issue by appending a cache buster to the end of the ajax call.

Offline

#4 2007-09-29 23:17:10

mhulse
Plugin Author
From: Eugene Oregon
Registered: 2005-01-21
Posts: 200

Re: [archived] dub_if_ajax -- was this page loaded directly or via JS?

Hi,

The demo is not working in Firefox 2.X on XP… Or is it just me? Looks like Firebug is complaining about something.

Otherwise, this looks like a useful plug. :)

Offline

Board footer

Powered by FluxBB