Re: Testing for Ajax

2009-12-11 Thread Mukhamad Ikhsan
on your action controller you can put this conditional

if ($this->RequestHandler->isAjax())  {}

in view you need consider this,
on ajax development you still need consider about graceful degradation, so
in every link there must consider if the javascript is not working.

http://www.xxx.com"; onClick="request.open('http://www.xxx.com";);return
false" />
on default, javascipt will be executed but the link is still work in classic
way.

On Fri, Dec 11, 2009 at 11:16 AM, Jeremy Burns  wrote:

> Thank you - I don't suppose you have a simple example do you?
>
> On Dec 11, 4:12 am, "Dr. Loboto"  wrote:
> > Pass one URL to AJAX link as link url and other to it's options as
> > AJAX action param.
> >
> > On Dec 10, 11:37 pm, Jeremy Burns  wrote:
> >
> >
> >
> > > Thank you, but that isn't working for me. I have a link that retrieves
> > > some data and populates a div with an element. With Javascript
> > > disabled I just get the contents of the element in an otherwise blank
> > > screen. What I want to do is something like this:
> >
> > > If (javascript is enabled):
> > > show this link
> > > else
> > > show another link
> > > end if
> >
> > > So what I am looking for is a nifty little piece of code to do the "if
> > > javascript is enabled" bit.
> >
> > > On Dec 10, 5:27 pm, "Dr. Loboto"  wrote:
> >
> > > > AJAX links and forms in Cake AJAX helper has fallback. If JS is not
> > > > enabled links/forms will work as normal ones.
> >
> > > > On Dec 10, 6:58 pm, Jeremy Burns  wrote:
> >
> > > > > I want to use the Ajax helper when Javascript is enabled, but
> revert
> > > > > to the plain old ordinary html helper when it is not. How can I do
> a
> > > > > simple test to see if Javascript is enabled?
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
Mukhamad Ikhsan
Y!id:ikhsan.only
http://www.diodachi.com

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Testing for Ajax

2009-12-10 Thread Jeremy Burns
Thank you - I don't suppose you have a simple example do you?

On Dec 11, 4:12 am, "Dr. Loboto"  wrote:
> Pass one URL to AJAX link as link url and other to it's options as
> AJAX action param.
>
> On Dec 10, 11:37 pm, Jeremy Burns  wrote:
>
>
>
> > Thank you, but that isn't working for me. I have a link that retrieves
> > some data and populates a div with an element. With Javascript
> > disabled I just get the contents of the element in an otherwise blank
> > screen. What I want to do is something like this:
>
> > If (javascript is enabled):
> > show this link
> > else
> > show another link
> > end if
>
> > So what I am looking for is a nifty little piece of code to do the "if
> > javascript is enabled" bit.
>
> > On Dec 10, 5:27 pm, "Dr. Loboto"  wrote:
>
> > > AJAX links and forms in Cake AJAX helper has fallback. If JS is not
> > > enabled links/forms will work as normal ones.
>
> > > On Dec 10, 6:58 pm, Jeremy Burns  wrote:
>
> > > > I want to use the Ajax helper when Javascript is enabled, but revert
> > > > to the plain old ordinary html helper when it is not. How can I do a
> > > > simple test to see if Javascript is enabled?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Testing for Ajax

2009-12-10 Thread Dr. Loboto
Pass one URL to AJAX link as link url and other to it's options as
AJAX action param.

On Dec 10, 11:37 pm, Jeremy Burns  wrote:
> Thank you, but that isn't working for me. I have a link that retrieves
> some data and populates a div with an element. With Javascript
> disabled I just get the contents of the element in an otherwise blank
> screen. What I want to do is something like this:
>
> If (javascript is enabled):
> show this link
> else
> show another link
> end if
>
> So what I am looking for is a nifty little piece of code to do the "if
> javascript is enabled" bit.
>
> On Dec 10, 5:27 pm, "Dr. Loboto"  wrote:
>
>
>
> > AJAX links and forms in Cake AJAX helper has fallback. If JS is not
> > enabled links/forms will work as normal ones.
>
> > On Dec 10, 6:58 pm, Jeremy Burns  wrote:
>
> > > I want to use the Ajax helper when Javascript is enabled, but revert
> > > to the plain old ordinary html helper when it is not. How can I do a
> > > simple test to see if Javascript is enabled?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Testing for Ajax

2009-12-10 Thread Jeremy Burns
Thank you, but that isn't working for me. I have a link that retrieves
some data and populates a div with an element. With Javascript
disabled I just get the contents of the element in an otherwise blank
screen. What I want to do is something like this:

If (javascript is enabled):
show this link
else
show another link
end if

So what I am looking for is a nifty little piece of code to do the "if
javascript is enabled" bit.

On Dec 10, 5:27 pm, "Dr. Loboto"  wrote:
> AJAX links and forms in Cake AJAX helper has fallback. If JS is not
> enabled links/forms will work as normal ones.
>
> On Dec 10, 6:58 pm, Jeremy Burns  wrote:
>
>
>
> > I want to use the Ajax helper when Javascript is enabled, but revert
> > to the plain old ordinary html helper when it is not. How can I do a
> > simple test to see if Javascript is enabled?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Testing for Ajax

2009-12-10 Thread Dr. Loboto
AJAX links and forms in Cake AJAX helper has fallback. If JS is not
enabled links/forms will work as normal ones.

On Dec 10, 6:58 pm, Jeremy Burns  wrote:
> I want to use the Ajax helper when Javascript is enabled, but revert
> to the plain old ordinary html helper when it is not. How can I do a
> simple test to see if Javascript is enabled?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en