Drupal AJAX manifesto (working copy)
public
group: Javascript
nedjo - Tue, 2006-05-09 17:53
Drawing on recent discussions, here's a draft AJAX manifesto. The idea is to sum up a shared approach and plans. Please wade in and edit, change, expand, comment, etc.
- Principles
- Usability and efficiency: AJAX (and js) are focused solidly on improving usability and efficiency--not on making things gratuitously flashy.
- Progressive enhancement: All pages are fully usable without Javascript.
- Clean attachment: Behaviours attach themselves only if they are supported. Instead of inline Javascript calls, behaviours are attached dynamically to targeted elements (usually based on css classes).
- Compatibility: Drupal AJAX developers cooperate to ensure that their behaviours are compatible.
- Behaviours accept effects: Rather than hard-coding behaviours to a specific effect library, we develop behaviours generically so that they can be picked up by various effects.
- Approaches
- Register behaviours: All behaviours are registered so that other behaviours know about them and can call them. All behaviours may be reapplied.
- Expose effects: All effects (collapse, scroll to, append content, etc.) should be exposed so that effects libraries can attach effects.
- Workplan
- Build shared library: Build a library where we can register a shared set of helper functions, configuration data, behaviour registration, etc. This library also will be a testing and development ground where methods will be piloted for eventual incusion in Drupal core. Initial development will be in the Javascript Tools package, as a new module, jstools.module, with a jstools.js library. Drupal AJAX and JS module developers will be encouraged to use and contribute to this library.


The user should decide
petermoulding.com/web_architect
javascript
you do that by disabling javascript in your browser. some browsers let you do that on a site by site basis. when you visit a drupal site ith javascript enabled and a modern DOM, you are advertising to the site that you support certain capabilities, and thus drupal has eveyr right to use them. my .02
Agreed
Yeah, you're going to find that its the same demographic of users who don't want JS as don't want AJAX... so we can assume that they've got JS turned off.
For this reason, we should (and will) consider non-JavaScript compatibility for AJAX functionality -- in my opinion, that's just part of the process of developing AJAX.
That being said, I do believe that there are higher-level non-compatible options that we might be able to offer in the admin area. For instance, in-line editing and rearranging of menus and/or taxonomy terms would be really great, however there's not really an easy way to replicate drag-and-drop in a backwards compatible way. But I could see these types of options replicated as a separate tab -- "ajax edit" or something... At least that's the direction I'm headed in with S/P Ajax.
SEO
We've done a healthy amount of work to make sure our use of AJAX downgrades and place nicely for not only users but also Search Engine Optimization ... if search bots can index the data you'd like searchers to find, then you decrease your potential findability.
Why not?
I was just wondering: why should we worry so much about javascript compatibility and old browsers?
I am not a javascript developer, but i guess is not that easy to satisfy every principle listed above, and survive. If it is, and the code is still maintainable, it must be done. If not? Are we sure it's really necessary?
Browsers are free. They don't have compatibility problems. They just get better (at least they should). Users could and should (why not?) download the latest version if it makes life easier for the developers and for the user himself. Maybe a new browser means a slower pc? I don't know. Is it so confusing for the average user to download a new browser? Is it a nightmare for the system administrator of a large intranet? Could be a problem to let the user see a broken web application without knowing why? If so, what is the oldest version we should reasonably expect to support?
Sorry, I am asking because I need to understand better Ajax and the problems behind, before using it in my projects.
I think we can only support
I think we can only support the browsers supported by jQuery. (I googled for a list of supported browsers, but came up short.) If our implementation of javascript (with or without jQuery) reduces this compatibility, then that would need to be addressed.
nedjo
thanks for this specification, I think it covers the topic well. I assume that this will go in the Handbook eventually and we will want to expand on some details for that purpose - but that will come.