A LIST Apart: For People Who Make Websites

No. 218

Discuss: Behavioral Separation

Pages

« First  <  6 7 8

71 Nice topic

Nice topic Ted,
Its open my eyes once again

posted at 08:05 am on October 25, 2008 by syahrir nasser

72 What do you do with the more complex situations

I appreciate the concept of unobtrusive JavaScript, I am constantly working on better techniques. The question is, when it isn’t a simple example how do you handle the increased amounts of conditions and work that have to be done?

First, the example of the store inventory and paginating through pages of items via AJAX. In this example, an AJAX request would pull content for the container it would be loading into. Without JavaScript enabled, an HREF would request a the same template, but based on that request type would load additional files necessary for a full layout. Does every framework identify for the user what the request type was (AJAX, XML, HTML) so that conditionals may be written in each template? Is that the suggested solution in these situations? It seems cumbersome, how do you go about overriding the potentially large number of hrefs you want to hijack? Just apply a generic class to each?

In addition to that, lately I have been writing a class to one of the main containers using JavaScript, such as ‘jsenabled’. Children of that container that have elements or effects dependent on JavaScript have declarations styled against that class. This works painlessly when your design is basic, but when you are working with a designer or client that likes complicated designs having to style things like a select box, then style its DHTML substitute starts to add a lot of work quickly.

What are your thoughts and experiences on this? I always seem to work out a solution, but I wanted to pick the brains of some of the experts on preferred practices.

posted at 03:53 pm on December 30, 2008 by Anthony Carcelli

Pages

« First  <  6 7 8

Discussion Closed

New comments are not being accepted, but you are welcome to explore what people said before we closed the door.

Got something to say?

Discuss this article. We reserve the right to delete flames, trolls, and wood nymphs.

Create a new account or sign in below if you’d like to leave a comment.

Remember me

Forgot your password?

Subscribe to this article's comments: RSS (what’s this?)