Search results:

    a few new apps

    I always lag behind Jon when it comes to trying out build tools or frameworks that are supposed to make my programming life easier. He tells me about cool new things he’s using, and I say “yeah, that looks cool, but I just want to be productive, so I’ll do things they way I’ve been doing them.” Then eventually I get a chance and I try out the cool thing and Jon was right, it’s totally great. That happened for me recently with Yeoman and Bower.

    Continue reading →

    triggering events in an iframe

    Recently, I had need to change the value of a select menu in an iframe from the outer page containing the iframe. There was a change event listener that had been added in the iframe’s JavaScript:

    // iframe's JavaScript
    document.getElementById('menu').addEventListener('change', function() {
      console.log('change callback triggered!');
    });
    

    I wanted to change the value of the select menu and for the change callback to happen. As you can see, the iframe didn’t use jQuery to set the change event handler, so I couldn’t do the following:

    // doesn't trigger callback function!
    var iframe = $('iframe');
    var iframe_select = iframe.contents().find('select#menu');
    iframe_select.val(value);
    iframe_select.trigger('change');
    

    That didn’t work. I could inspect the select menu after this code ran and its value was definitely updated, but the change callback never happened.

    What ended up working for me was the following code. I’d never used createEvent, initUIEvent, and dispatchEvent before, so I thought I’d share:

    // parent page's JavaScript
    var iframe = $('iframe');
    var iframe_select = iframe.contents().find('select#menu');
    iframe_select.val(value);
    var ev = iframe[0].contentWindow.document.createEvent('UIEvents');
    ev.initUIEvent('change', true, true, window, 1);
    iframe_select[0].dispatchEvent(ev);
    

    my new Fitbit

    I recently ordered a Fitbit Zip because I missed the Moves app but didn’t want to return to them now that they’ve been acquired by Facebook. I also wanted something I could carry around more easily on my person than my phone. Sure, I take my phone almost everywhere I go, but I have to remember to grab it if I’m going to go downstairs or otherwise take a quick walk. With a Fitbit, my hope was to always wear it without even having to think about it.

    Continue reading →

    first impressions of Google Music All Access coming from Rdio

    Recently, I became interested in Google Music All Access and decided to try it. I had already used my free month back when the service first became available, so this time around I had to shell out $10/month. I’m used to that price, though, having paid the same for Rdio and Spotify before it. I went ahead and cancelled my Rdio subscription because I only need one streaming service at a time.

    Continue reading →

    SimCity

    I found SimCity Plus on sale on Origin for $20 last week. I checked on Reddit if it was worth it and was told that with the inclusion of the Cities of Tomorrow expansion, which came with the Plus version, it was. I bought it and was super excited to try it because I’ve been really enjoying Tropico 4 and wanted to experience the new SimCity.

    Continue reading →