Yii Framework Forum: Can ajaxLink degrade to a regular link? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Can ajaxLink degrade to a regular link? Rate Topic: -----

#1 User is offline   Onman 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 175
  • Joined: 26-December 09
  • Location:The Netherlands

Posted 14 March 2010 - 08:57 AM

I want to use as many ajaxLinks as possible in my website. But if the user has disabled javascript the ajaxLink should degrade to a regular link.

Does anyone have an example of how to accomplish this?

Please bear in mind that I've never programmed even 1 letter in javascript (I can read it, though).
0

#2 User is offline   OriginalCopy 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 63
  • Joined: 13-March 09

Posted 15 March 2010 - 07:56 AM

The first step to make your app js-degradable is to not introducing javascript at all.
In the second step you hook into jQuery.ready() for the document, traverse your DOM dynamically and attach event handlers to them (to links, submit buttons, etc).

If the user doesn't have js prior to visiting your page, document.ready is not triggered at all (as there's no javascript support), thus your page will be left as it is (how you designed it in the first step).
1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users