• Feb
    18
    2009

    Be Careful parsing your URL string with Javascript

    …so I know you’ve looked around the net for a good method to parse URL variables with javascript, and I’m sure that you’ve found some elegant method that looks something like:
    function parseLocation() {
    var turl = window.location.search;
    ar = turl.split(’&’);
    var b = {};

    for (var i = 0; i < ar.length; i++) {
    var c = ar[i].split(’=');
    b[c[0]] = c[1];
    }
    return [...]

  • Feb
    02
    2009

    This one fires on pretty much all cylinders for me:

    Music Nerd
    Programming Nerd
    Irony Nerd
    Economics Nerd
    Net Humor Nerd
    Stats Nerd
    Charts & Graphs Nerd
    Liberal Political Value System Nerd

    Share/Save

 
Powered by Wordpress and MySQL. Theme by openark.org