How do you go about loading the response received from an HTTPRequest into a variable using jQuery?

I tried my ass off without success.

Examples that doesn´t work:

$(document).ready( $('selector').submit( function(){
var req = $.get('url.php', "data: data");
response = req.responseText;
});

but response = "".

I tried this then:

$(document).ready( $('selector').submit( function(){
var req = $.ajax(
url: 'url.php'
data: 'user=whatever&pass=whateverelse'
success: function(){
response = req.responseText;
}
});

Doesn´t work either.


I am clueless.