这是我到目前为止的代码。
<html>
<head>
<title>jQuery</title>
<script type = "text/javascript" src = "js/jquery-3.1.1.min.js"></script>
<script type = "text/javascript" language = "javascript">
$(document).ready(function() {
$("#driver").click(function(event){
var name = $("#name").val();
$("#stage").load('result.cfm', {"name":name} );
//$("#test").val(name);
});
});
</script>
</head>
<body>
<p>Enter your name and click on the button:</p>
<input type = "input" id = "name" size = "40" /><br />
<div id = "stage" style = "background-color:ccc;">
STAGE
</div>
Results
<input type = "button" id = "driver" value = "Show Result" />
<br><br><br>
Name:
<input type = "input" id = "fullname" size = "40" /><br />
Age:
<input type = "input" id = "age" size = "6" /><br />
Sex:<br>
<input type="checkbox" value="m"> Male <br>
<input type="checkbox" value="f"> female <br>
</body>
</html>
<!---
Result.cfm example returned.
{
"name": "Zara Ali",
"age" : "67",
"sex": "female"
}
---&GT;