[ckan-dev] CKAN and JavaScript

Aron Carroll aron.carroll at okfn.org
Tue May 29 14:44:24 UTC 2012


Hi all,

I've been asked to summarise the general approach to using JavaScript on CKAN
moving forward.

As CKAN is a website designed to enable users to find and explore datasets
and can be deployed in a wide variety of environments it's very important that
the site is usable by as broad an audience as possible.

So all key features of the site should be implemented and work without
JavaScript. This provides the following benefits.

* The site content is indexable and searchable via search engines like Google.
* Content is accessible to screen readers and other assistive technology.
* The site functions for users without JavaScript enabled, while the scripts load or
  if an error occurs breaking the app.
* Keeping JavaScript to a minimum reduces load times and keeps page weight
  down.

It also keeps majority of the application in Python which is the primary language
of the CKAN team and reduces the maintenance cost of having large portions of
application logic in two places.

This means adding using HTML forms that submit to CKAN rather than directly to
the API. Providing error messages in the HTML source and ensuring all content
is included in the html source on page load. JavaScript can then be used to make
features richer and enhance the experience.

Some features such as the data previewer are going to require JavaScript. Others
are more complicated, for example the search facets. Ideally these would provide
the same functionality with or without JavaScript but there is an argument that
they provide auxiliary functionality as long as the basic form works on it's own.
These should be evaluated and discussed on a feature by feature basis.

Cheers,
Aron



More information about the ckan-dev mailing list