Which jQuery Function Should I Use: load() or ajax()?
At the moment I am using the ajax function like so:

    $.ajax({
        type: 'get',
        url: 'ajax_requests.php?action=get-list-of-all-users',
        data: '',
        success: function(output) {
            $('div.showHere').html(output);
        }
    });


The php file `ajax_requests.php` has a switch statement which executes various commands based on the value it receives through the get parameter in the url.

So I'm not actually passing anything through the `data` parameter of the ajax fuction. I'm just telling the php script what I want done through the url.


Today it occurred to me that I could just well use the load() function. I can just do this to get the same result as above:


    $('div.showHere').load('ajax_requests.php?action=get-list-of-all-users');

As long as I am using the `GET` method it seems like the much shorter code above is the better way to perform ajax requests. But I don't know much about jQuery or ajax to make the descision myself. So which should I use? and is load() better performance wise than using ajax() in this situation?







Which jQuery Function Should I Use: load() or ajax()?
===

At the moment I am using the ajax function like so:

    $.ajax({
        type: 'get',
        url: 'ajax_requests.php?action=get-list-of-all-users',
        data: '',
        success: function(output) {
            $('div.showHere').html(output);
        }
    });


The php file `ajax_requests.php` has a switch statement which executes various commands based on the value it receives through the get parameter in the url.

So I'm not actually passing anything through the `data` parameter of the ajax fuction. I'm just telling the php script what I want done through the url.


Today it occurred to me that I could just well use the load() function. I can just do this to get the same result as above:


    $('div.showHere').load('ajax_requests.php?action=get-list-of-all-users');

As long as I am using the `GET` method it seems like the much shorter code above is the better way to perform ajax requests. But I don't know much about jQuery or ajax to make the descision myself. So which should I use? and is load() better performance wise than using ajax() in this situation?






