我有三个代码文件应该返回一个按下的字符,但他们不会。相当新的http可以有人发现我的错误? (所有三个文件都在同一目录中)
httpgetexample.htm
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
</head>
<body style="background-color: darkgreen">
<input type="text" id="name"></input>
<div id="name_feedback"></div>
<script type="text/javascript" src="jfunc.js"></script>
</body>
</html>
jfunc.js
]$('#name').keyup(function(){
var name = $('#name').val();
$.post('process_name.php',{name: name}, function(data){
$('#name_feedback').html(data);
});
});
process_name.php
<?php
if(isset($_POST['name'])){
$name = $_POST['name'];
echo strrev($name);
}
?>