Right now, I'm using jQuery's ajax like the following:

function hello_world(param1, param2, param3, param4)
{
    $.ajax(
    {
        type: 'POST',
        url: 'foo.php',
        dataType: 'html',
        data: 'param1=' + param1 + '&param2=' + param2 + '&param3=' +
param3 + '&param4=' + param4,

        success: function(data)
        {
        }
    });
}

In foo.php, I retrieve the parameters like:

$_POST['param1], ...

Is there a more elegant way to pass the parameters on the javascript
side?

Reply via email to