page1.php could be used to check the request header, but sometimes it
is easier to do another page than change an existing one.

-- Sam

Ca-Phun Ung wrote:
> I'm a little confused. So you want to use page1.php or page1_ajax.php
> depending on whether Ajax is used. However you are also sending the
> X-Requested-With header? Wouldn't it be simpler to use page1.php for
> both Ajax and non-Ajax then let PHP whether to return a full page or
> partial page depending on the X-Requested-With header? Or are you
> already doing that :)
>
> Sam Collett wrote:
> > At the moment, the tabs plugin uses ajax on the href attribute and
> > loads it's content. To improve graceful degradation, how would you get
> > it to use rel instead? For instance:
> >
> > <li><a href="page1.php" rel="page1_ajax.php"><span>Tab 1</span></a></
> > li>
> >
> > At the moment, page1.php would be loaded into a tab. page1_ajax.php
> > would be the preferred page to load if ajax is used. page1.php
> > contains the whole page, including navigation etc, but page1_ajax.php
> > only contains the contents.
> >
> > The only workaround is to check the request headers on the php page
> > and send the contents only if it is an AJAX request:
> >
> > if($_SERVER["X-Requested-With"] == "XMLHttpRequest")
> > {
> >     .... send content only
> > }
> > else
> > {
> >     .... send whole page
> > }
> >
> > >
> >

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to