Archives for Friday, June 12th, 2009

You are currently browsing 1 articles posted Friday, June 12th, 2009.

  • Super Simple Ajax (Without a Framework)

    Published Friday 12th of June 2009

    If you're looking for the bare minimum when it comes to doing cross-browser GET or POST XHR then this might be the script for you.

    I know there's hundreds (probably thousands) of these scripts out there already but even the most lightweight ones I could find seemed kind of bloated.

    Example

    // GET latest-comments.php and update the #latest-comments element
    superSimpleAjax({url'latest-comments.php'}, 'latest-comments');

    // GET article with ID 12 and alert its contents
    superSimpleAjax({
        
    url:        'get-article.php'
        
    data:        'id=12'
        
    callback:    function (data) {
            
    alert(data);
        }
    });

    // POST a comment to post-comment.php
    superSimpleAjax({
        
    method:        'POST'
        
    url:        'post-comment.php'
        
    data:        'author=John Doe&email=johndoe@johndoe.com&content=Hi, my name is John Doe'
        
    callback:    function (data) {
            
    alert('Thanks for your comment!');
        }
    });

    Grab the code from Google Code. It's about 1k uncompressed.

    Enjoy!

    Be the first to post a comment

Random jQuery Plug-ins

  • Tag Sizes

    Use this plug-in on a list of tags (li:s) and it will use whatever numbers found in the list to give each tag a corresponding size.

    Details

  • Vibrate

    This plug-in makes any element you want "vibrate" every now and then. Can be used in conjunction with blink for maximum annoyance!

    Details

  • Image Zoom

    This plug-in makes links pointing to images open in the "Image Zoom". Clicking a link will zoom out the clicked image to its target-image. Click anywh...

    Details

More Plug-ins

Recent Comments

  1. Andreas on "SleekPHP User Handling"

    Thank you for showing interest :) Were the docs en...

  2. ciptard on "SleekPHP User Handling"

    Ok, thank you

  3. Andreas on "SleekPHP User Handling"

    I might write a "getting started" article for Slee...