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.