Ajax表单输入

Im trying to build a form which uses AJAX but its failing to execute properly heres the code of my first file:

<html>
<head>
<script language="JavaScript" type="text/javascript">
function ajax_post(){

var hr = new XMLHttpRequest();

var url = "my_parse_file.php";
var fn = document.getElementById("first_name").value;


hr.open("POST", url, true);

hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
hr.onreadystatechange = function() {
    if(hr.readyState == 4 && hr.status == 200) {
        var return_data = hr.responseText;
        document.getElementById("status").innerHTML = return_data;
    }
}
hr.send(fn);
document.getElementById("status").innerHTML = "processing...";
}
</script>
</head>
<body>
<h2>Ajax Post to PHP and Get Return Data</h2>
 Todo: <input id="first_name" name="first_name" type="text" /> 
<br /><br />

<input name="myBtn" type="submit" value="Submit Data"     onClick="javascript:ajax_post();">
<br /><br />
<div id="status"></div>
</body>
</html>

and heres the second:

<?php 
echo  $_POST['firstname'];
 ?>

All it does is show the "processing..." and then it goes blank...any way around this?

I think it's because you're not passing a key value pair.

hr.send('firstname=' + encodeURIComponent(fn));