Use data argument for ajax request

The parameters need to be url-encoded to prevent and invalid characters
in the parameters (if using & in a field for example).