rc3.org

Strong opinions, weakly held

Tag: JavaScript (page 2 of 3)

Links from July 9th

Determining whether to hide a report filter

Let’s say you have a report that has some filter controls on top that let you narrow the scope of the report. When the report loads, the filter is collapsed. The user opens the filter, changes some of the settings, and submits the form. What is the preferred method for determining whether the filter should be displayed? A related question is whether you should detect the filter’s visibility status in JavaScript or you should check on the server side and use the style attribute to control visibility.

Here are some options:

  • Always leave the filter collapsed initially. I hate this option, though, because it hides important information from the user. If the report is in some non-default state, the user should be able see when it loads what that state is.
  • Check to see whether any form parameters were submitted. If there were, add the appropriate style attribute to the form on the server side.
  • Assuming the GET method was used, check for a query string in JavaScript and hide the form using JavaScript if no query string is present. (Indicating that the filter is in its default state.)
  • Using JavaScript, check the values of all of the fields on the form to see whether they are in their default state. If not, display the form.
  • Use a hidden form field set on the server side to indicate that the filter should be displayed. In JavaScript, check that field to determine whether or not the filter should be displayed.

There are probably other options as well, and all of them will work. Choosing from among them is a matter of ease of maintenance, mostly. Ideas?

Links from May 31st

Links from May 26th

I have a number of Sonya Sotomayor links today.

Links from May 22nd

Today’s batch of links:

Links from May 20

Long delayed roundup of links:

Links from March 23rd

There are a whole ton of links in the backlog today.

Links from January 24th

Links from January 23rd

I’m going back to packaging up my del.icio.us bookmarks daily and posting them here.

  • The Black Triangle is an article from 2004 about game development found by Jason Kottke. It describes the disconnect between programmers and users, where users are unimpressed by seeing something relatively simple on the screen, and developers are thrilled at the huge amount of work that into getting that simple thing onto the screen. I’ve found it’s never a good idea to show customers the Black Triangle. It always comes later in the process than they’d think and often freaks them out.
  • waferbaby: The Setup. Interviews with people about their computer setups. I can never read enough of these.
  • New York Times: Gazan Doctor and Peace Advocate Loses 3 Daughters to Israeli Fire and Asks Why. The horrific cost of war.
  • Dr. Saturday: Australian Rules’ blood’s worth bottling. A proposed playoff structure for college football. A more interesting approach
  • Going.com: Newspapers Covering Obama’s Inauguration. A huge collection of newspaper front pages from President Obama’s inauguration. And yes, it still feels weird to type “President Obama.”
  • CSS Newbie: The EqualHeights jQuery Plugin. I’m always looking for better ways to set columns to equal heights on a Web page.
  • Glenn Greenwald: Mohammed Jawad and Obama’s efforts to suspend military commissions. When anyone questions whether the United States tortures people or tortures the wrong people, you can forward them the story of Mohammed Jawad, a teenager captured in Afghanistan who was coerced to confess to killing US soldiers with a grenade. The military prosecutor in his case petitioned that he should be released and ultimately resigned rather than prosecute him.

jQuery is awesome

I’ve been convinced for some time that jQuery is the best JavaScript library around. What I am coming to realize is that it’s also one of the best-run open source projects around as well. jQuery 1.3 (released today) has a new selector engine, a key component of any modern JavaScript library. To encourage other projects to adopt their selector engine, the jQuery project has turned it over to the Dojo Foundation, which currently manages the Dojo Toolkit, a jQuery competitor:

More importantly, though, we’re taking a big leap with Sizzle: We’re releasing it as a completely standalone project to be collaborated upon by many library creators and developers. We saw an opportunity to give something back to not just the jQuery community but to the JavaScript development community as a whole; and at the same time be able to collaborate with developers of other libraries on a single, unified, selector engine. We feel that there’s too much competition and not enough collaboration occurring and so we put our coud out on the line as a good first step towards working together.

As a sign of good faith and willingness to collaborate, we’ve turned over Sizzle to the Dojo Foundation (an excellent non-profit well suited for this project, not to be confused with the Dojo Toolkit). We wanted a common meeting ground where all developers would be able to work together and under which there would be a clear long-term copyright holder.

Older posts Newer posts

© 2024 rc3.org

Theme by Anders NorenUp ↑