I am trying to send the username to php
using ajax
.
Here is my js
.
$('#username').blur(function(){
var username = $("#username").val();
$.ajax({
type: "POST",
url: "dbquery.php",
data: username,
success: function(result){
$("#dbdata").html(result);
}
});
});
And here is php.
$value = $_GET['username'];
I know it is about the ajax
because everything worked fine when the ajax
part was written in pure javascript
.