JSFiddle

  • browser lang

    What is the language passed through the browser from the system, or at least what language does the browser think it is?

    // Check for language of device/browser.
    // Not a lot of code. Anyone else got some secret sauce
    // that isn't ...
  • Does watchPosition followed by clearWatch work?

    Was debugging a Firefox OS application and noticed that clearWatch wasn't working on one of the devices. This is a simple test to isolate the problem.

    var log = function(message) {
        document.body.innerHTML += "<p>" + new Date() + ": " + message + "</p>"
    };
    var runningId = navigator.geolocation.watchPosition(function() {
        log("watchPosition success function ...
  • ECMAScript 5 Property Descriptors #2 is the latest revision

    Some random experiments with the functionality of ECMAScript 5 property descriptors.

    var log = function(message) {
        document.body.innerHTML += ["<br/>",
                                    message].join("");
    };
    
    var o = Object.create({
            _val: 42
        }, 
        {
            val: {
                get: function() {
                    return this ...</br/>
  • CSS Selector Specificity

    Demonstration of selector specificity with a transposed order: the least specific selectors are on the bottom of the file.

    <ul>
        <li id="story-extra" class="story extra">Story Extra</li>
        <li id="miss-pross" class="character miss pross">Miss Pross</li>
        <li id="doctor-manette" class="character doctor manette">Doctor Manette</li>
        <li id="lucie-manette" class="character lucie manette">Lucie Manette</li>
        <li id="madame-defarge" class="character madame defarge"
        style="color: red;">Madame Defarge</li>
        <li id="sydney-carton" class="character sydney carton redeemed"
        style="color: red;">Sydney Carton</li>
    </ul>
  • CSS Positioning #5 is the latest revision

    Demonstrating the basics of the 4 types of CSS positioning: static, absolute, relative, and fixed.

    <div id="control" class="test">control</div>
    <div id="position-fail" class="test">position fail</div>
    <div id="page-fixed" class="test">page fixed</div>
    <div id="page-absolute" class="test">page absolute</div>
    <div class="test-container">
        <div id="static-contained-relative" class="test">static contained relative</div>
    </div>
    <div class="test-container">
        <div id="static-contained-absolute" class="test">static contained absolute</div>
    </div>
    <div class="test-container relative-position-parent">
        <div id="relative-contained-absolute" class="test">relative contained absolute</div>
    </div>