Archive for the “Web Development” Category

Firebug – debug your applications. An absolute must. Best features:
  • Debugger – step through, over, etc.
  • Console log for monitoring AJAX interactions -shows parms sent, data returned, round-trip time.

  • Web Developer – fantastic CSS diagnostic support. Best features:
    • View generated source – important if your script modifies the original DOM of your page
    • Display Element Information – shows all the properties of an element in a convenient popup. To use, press Ctrl+Shift+F or select menu Information/Display Element Information
    • Edit CSS – lets you edit the CSS selectors in real-time, and shows you the results – almost as you type
  • MeasureIt. Lets you find the height and width of any element or area of the page, in pixels. Helps diagnose CSS issues, for example, when you use combinations of margin, width, padding and border attributes.
  • Codeburner from Sitepoint, one of my favorite online journals (www.sitepoint.com). Integrates with Firebug to provide comprehensive cross-reference information on HTML and CSS. Best feature:
    • Browser compatibility tables
    Tags: , , , ,
  • Comments 1 Comment »

    Summary: Quirks of checkbox markup in HTML – differences between IE and FireFox…

    Tags: , , ,

    Comments No Comments »

    This post explains how to set a group of checkboxes to checked or unchecked using jQuery 1.3, by clicking an “All” or “None” button.

    First, let’s select our group of checkboxes. I’ve seen some fairly complicated jQuery selectors for finding checkboxes on a page, but it seems to me the easiest thing to do is just assign a common class to each one in a group, even if you don’t define the class in your stylesheets. Like this:

    <input type="checkbox" class="selsts" name="selsts" value="E"> Emailed
    <input type="checkbox" class="selsts" name="selsts" value="W"> Work in Progress
    <input type="checkbox" class="selsts" name="selsts" value="P"> Pending client call
    <input type="checkbox" class="selsts" name="selsts" value="R">R-Returned call

    the jQuery selector for this is: $(".selsts") .

    We could also select all the elements based on their common name, which I think goes like this: $(['name=selsts']) .
    But I prefer classes, because you can easily change their names without affecting server-side code that may be dependent on form field names.

    Let’s say we have two buttons on our page, using the following markup:

    Select: <input type="button" id="allsts" value="All">, <input type="button" id="nosts" value="None">

    To make all our checkboxes checked:

    $("#allsts").click(function() {
    $(".selsts").attr('checked', true);
    });

    To uncheck all the checkboxes:

    $("#nosts").click(function() {
    $(".selsts").attr('checked', false);
    });

    That’s it.

    To determine if a checkbox is checked or not, we can loop through the array like this:

    $('.selsts' ).each( function() {
    var isitchecked = this.checked;
    });

    Or, individually:

    if ($('#somecheckbox').checked == true) { blah blah ... }

    Tags: ,

    Comments 2 Comments »

    FireFox doesn’t have a native global event handler. Here’s how to create one using FireFox’s event-capturing model.

    Tags: , , , ,

    Comments 4 Comments »

    Firebug beta 1.0 is now available. This is by far the best toolbar available for FireFox or IE for debugging web applications. See This blog entry at Sitepoint for more details.  A few  of the features I really like are:

    • The debugger  – identifies exact line of script in error.
    • The HTML view – lets you view contents of externally linked Javascript files, also.
    • The CSS inspector – shows you all ancestor css rules for elements, not just the current CSS rule, so you can see the total effect of the cascade.
    • The ability to change CSS settings on the fly. For example, hover over a color, click on it, then change the RGB value to see another color – it does this for the specific area on the page, as well as in the sheet.
    Tags: , ,

    Comments 2 Comments »