Representative line



  • Found this gem while doing maintenance on a site that's a huge pile of static HTML files:




    [code]
    $('.bottom_content a').each(function(){
    var temp = $(this).html().replace('ClientName¬ÆClientService','ClientName®ClientService');
    $(this).html(temp);

    });
    [/code]




    ClientName/ClientService redacted

    This is in a global javascript function that runs on every page. Yes, that's right, the author is using JQuery to look for a specific instance of a UTF error in a specific location on pages, and replacing it with the superscript HTML encoded registration mark.

    Of the 400-500 HTML files that trigger this global script, only about 40-50 of them actually contain the specific dom elements being targeted. And those all have the exact same HTML structure.

    In the amount of time it took the author to write this script, they could have just done a global search and replace of the source HTML files to correct the UTF error to begin with.



  • It's jQuery, that makes it really fast, right?



  • Well duh!  If they did a find-and-replace, they wouldn't be able to put "jQuery" on their resume.



  • @C-Octothorpe said:

    Well duh!  If they did a find-and-replace, they wouldn't be able to put "jQuery" on their resume.

    They could call themself a vim expert, though.



  • @Ben L. said:

    @C-Octothorpe said:

    Well duh!  If they did a find-and-replace, they wouldn't be able to put "jQuery" on their resume.

    They could call themself a vim expert, though.
    I think you missed the point.  You want to make your resume look *better*.

    [ducks]



  • @C-Octothorpe said:

    @Ben L. said:

    @C-Octothorpe said:

    Well duh!  If they did a find-and-replace, they wouldn't be able to put "jQuery" on their resume.

    They could call themself a vim expert, though.
    I think you missed the point.  You want to make your resume look *better*.

    [ducks]

    [geese]


  • @C-Octothorpe said:

    I think you missed the point.  You want to make your resume look *better*.

    [ducks]

     

    I agree! Putting vim on your resume just leads to responses such as "We can't emply you. You're overqualified."

     



  • @dhromed said:

    Filed under: HYPERSARCASM GOOOOOOOOOOOAL

    FTFY



  • It took me less time to do a global search/replace and strip out this function than it took me to write the original forum post.



  • @Ben L. said:

    It's jQuery, that makes it really fast, right?

    Yes because jQuery runs on Google's Canadian servers (that's what Google CDN means right?)

    Wow I think I just got the idea for a new interview question.



  • @dhromed said:

    Putting vim on your resume just leads to [b]you being arrested for perpetrating an anthrax hoax[/b].

    FTFY.



  • @dynedain said:

    In the amount of time it took the author to write this script, they could have just done a global search and replace of the source HTML files to correct the UTF error to begin with.
    You're assuming that the morons non-technical people that write the pages will write a proper <sup>&reg;</sup> next time they edit or write a page.

     


Log in to reply