AJAX in a Bottle: Jello AHAH

Discussion in 'OT Technology' started by Peyomp, Apr 16, 2008.

  1. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    I see people using bloated frameworks to do simple AHAH, and this saddens me, because when I started doing web development I explored many of these libraries and found that they mostly added thousands of lines of code and killed performance on my pages for... very little benefit. So I roll my own little AJAX functions. However, I also tend to write really ugly JS where I re-create these functions in each page one way or another. So, to remedy both problems I wrote and released this:

    http://xrl.us/bjgit

    Simple AHAH library. Put in the div you want to update, the url you want to pull the content from, the 'loading' image you want to display while the query happens, and an optional url-encoded argument string for a POST, and wallah... you have a dynamic update of a DIV's content. Pulled this together over a couple years from IRC, books, net snippets etc. and it works really well for me.
     
    Last edited: Apr 16, 2008
  2. Sexual Vanilla

    Sexual Vanilla New Member

    Joined:
    May 23, 2005
    Messages:
    6,305
    Likes Received:
    0
    Location:
    South Carolina
    I likey...will check this out when I get back to work tomorrow. :bigthumb:
     
  3. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    wallah == voila.

    But anyway, nice job. I might need this someday, who knows.
     
  4. GOGZILLA

    GOGZILLA Double-Uranium Member

    Joined:
    Jan 16, 2003
    Messages:
    10,760
    Likes Received:
    3
    Location:
    Plantation, FL
    wouldve been cooler if you named it HAHA or AH-HA...saying AH-AH is kinda weird
     
  5. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
  6. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    Viola = [​IMG]

    Wallah = [​IMG]

    Any questions?
     
  7. piratepenguin

    piratepenguin New Member

    Joined:
    Jun 18, 2006
    Messages:
    1,067
    Likes Received:
    0
    Location:
    Ireland
  8. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    Viola != Voila. Get your french straight.
     
  9. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    Fuck your french.

    [​IMG]
     
  10. Doc Brown

    Doc Brown Don't make me make you my hobby

    Joined:
    Mar 31, 2006
    Messages:
    16,404
    Likes Received:
    0
    Location:
    Ohio
    It's times like this that I wish I was in school. I've always been the creative type, and I would love to be able to tear into something like this.

    And no, not the freak in the last frame

    :squint:
     
  11. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    From the look of it, he's married anyway. Sorry Doc. :(
     
  12. FartLighter

    FartLighter Resident Fart Expert OT Supporter

    Joined:
    Jul 5, 2005
    Messages:
    2,850
    Likes Received:
    6
    Location:
    Mammoth Lakes, CA
    Is AHAH relatively new? I have only heard of AJAX for asynchronous transfer.
     
  13. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    AHAH is just AJAX where you send HTML instead of JSON/XML or Javascript. You just dynamically replace HTML in your document. Its the simplest kind of AJAX.
     
  14. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    I just released 0.2. I fixed stupid bugs (I didn't really test 0.1), and added doSyncGet9(url) and doSyncPost(url, args) to do synchronous requests. And uhh... validatePhone to validate phone numbers.
     
    Last edited: Apr 23, 2008
  15. wizziebaldwin

    wizziebaldwin New Member

    Joined:
    Nov 30, 2007
    Messages:
    60
    Likes Received:
    0
    Nice Job ... Code appears to be quite tidy.

    I tend to be anal about client side scripting ... I wish it didn't exist.

    Because most of my moneymakers (clients that actually pay me money) are using Microcheese Operating Systems that are that are prone to almost any kind of attack, a few baddies have originated from bad scripting, i tend to be wary of sites that use Java extensively.

    I like to program in PHP and I can do pretty much everything i want.

    It may be just a fraction slower when doing phone number, email, SSN, Bank Routing Number validations but i feel more comfortable.
     

Share This Page