KBD

Keith Devens .com

Saturday, May 17, 2008 Flag waving
"Fools! Don't they know that tears are a woman's most effective weapon?" – Catwoman (The Batman TV Series, episode 83)

Tag: Web Development

Daily link icon Monday, February 25, 2008

  1. IEBlog : File URIs in Windows.

       (0) Tags: [Web Development, Windows]

Daily link icon Thursday, February 14, 2008

  1. JavaScript Kit- DOM Table Object Methods.

       (0) Tags: [Javascript, Web Development]

Daily link icon Wednesday, February 13, 2008

Join a NameValueCollection into a querystring in C#

C# is ugly as heck:

private static string JoinNvcToQs(System.Collections.Specialized.NameValueCollection qs){
    return string.Join("&", Array.ConvertAll<string, string>(qs.AllKeys, delegate(string key){
        return string.Format("{0}={1}", HttpUtility.UrlEncode(key), HttpUtility.UrlEncode(qs[key]));
    }));
}

In Ruby, this would be (essentially):

e = URI.escape
qs.collect{ |k,v| e(k)+"="+e(v) }.join("&")

Daily link icon Monday, December 17, 2007

  1. AppJet: Instant Web Programming (via).

       (0) Tags: [Javascript, Web Development]

Daily link icon Monday, December 10, 2007

  1. Simon Willison: Comet works, and it’s easier than you think.

    Edit: see this, also via Simon.

       (0) Tags: [Web Development]

Daily link icon Thursday, August 16, 2007

  1. Simon Willison: jQuery for JavaScript programmers. Maybe I'll use jQuery instead of Prototype for future development.

       (0) Tags: [Javascript, Web Development]

Daily link icon Tuesday, August 14, 2007

  1. IEBlog : IE6 and IE7 Running on a Single Machine. Run IE6 through Virtual PC... Virtual PC and IE6 image all provided free by Microsoft.

       (0) Tags: [Web Development, Windows]

Daily link icon Monday, July 30, 2007

  1. Scale rails from one box to three, four and five (via).

       (0) Tags: [Ruby on Rails, Web Development]

Daily link icon Wednesday, July 25, 2007

  1. YSlow for Firebug (via). Clever name. Yahoo-developed plugin for Firebug that helps analyze site performance.

       (0) Tags: [Firefox, Web Development]

Daily link icon Friday, June 29, 2007

<select> utility javascript functions

I always wind up needing functions to dynamically populate the options on a <select> list, or select a given item in an existing <select>. So I've finally written them out in a reusable form:

<select id="foo" onchange="alert(this.value)"/>

<script language="javascript" type="text/javascript">
function loadSelectOptions(selectId, keys, values, selectedOption){
    var list = document.getElementById(selectId)
    if(!list)
        return;

    var selectedIndex = 0;
    list.length = 0;

    var found = false;
    for(var i=0,n=keys.length; i<n; i++){
        list.options[i] = new Option(values[i], keys[i]);
        if(selectedOption == keys[i]){
            list.selectedIndex = i;
            found = true;
        }
    }
    return found;
}

function selectSelectOption(selectId, value, runEvent){
    var list = document.getElementById(selectId)
    if(!list)
        return;

    var options = list.options;
    for(var i=0,n=options.length; i<n; i++){
        if(options[i].value == value){
            list.selectedIndex = i;
            if(runEvent)
                list.onchange();
            return true;
        }
    }
    return false;
}

loadSelectOptions("foo",['foo','bar','baz'], ['FOO','BAR','BAZ'],'baz')
var list = document.getElementById("foo")
list.remove(1)
selectSelectOption("foo","baz")
</script>

Daily link icon Monday, April 9, 2007

  1. Destroydrop » Javascripts » Tree. dTree has worked great for me so far.

       (3) Tags: [Javascript, Web Development]
May 2008
SunMonTueWedThuFriSat
 123
45678910
11121314151617
18192021222324
25262728293031



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 2 posts

Recent comments XML

new⇒Maps of Iraq

my husband is in Scania too..he​says it's not too bad..he's been at​worse...

Cristy: May 16, 3:54pm

"IMDB for music"

IMDB for Music? It looks to be a​couple of years old...​http://MusicTell.co...

Ken Empie: May 14, 9:57pm

Generated in about 0.179s.

(Used 10 db queries)