Thursday, 30 April 2009

Website stuff

This morning I checked my email and The Web Squeeze and then did some work on my website. I also went in the garden for a bit to see if I could take any insect photos, but although it was cloudy and windy, it was quite warm so all the insects were too active and kept moving about and flying away.

After lunch I went on Animal Crossing, then checked my email and The Web Squeeze again.

I did some more work on my website, just making some stuff work with jQuery. I found out that you can pass parameters to listener functions with jQuery by using bind. e.g. Before I was doing this:
//Add the ajax subcats lookup function to the category select box. We have to use call otherwise 'this' refers to the window rather than the select.
$('#category1').change( (function(depth){return function(){addSubCatList.call(this, depth);}})(2) );

function addSubCatList(depth)
{
//do stuff
}


But using bind directly I can do this:
$('#category1').bind( 'change', {'depth': 2}, addSubCatList );

function addSubCatList(e)
{
var depth = e.data.depth;
//do stuff
}
So, a lot easier to read and write.

In the evening I watched Lost and The Super Mario Bros. Super Show with Moc and L.

Food
Breakfast: Strawberry jam toast sandwich; cup o' tea.
Lunch: Barvarian smoked ham with iceberg lettuce sandwich; ½ Barvarian smoked ham with iceberg lettuce and mayonnaise sandwich; 2x small clementines; slice of Genoa cake; Fox's triple; cup o' tea.
Dinner: Chicken & mushroom in white wine sauce pie; green beans; potatoes; carrots; gravy. Pudding was a slice of Genoa cake. Coffee.

No comments: