好吧我有一个按钮,当用户点击它时,它有禁用和淡入消息感谢我们将尽快处理此问题 但现在我想要做的是当用户点击按钮,它会关闭,然后将张贴到PHP文件(比如:error.php)这error.php会是这样如何使用jQuery POST到PHP文件
<?php
if(isset($_POST['submit'])){
$ip= $_SERVER['REMOTE_ADDR'];
$page= $_SERVER['REQUEST_URI'];
// now update these to sql database ..... and if successfully posted return true
}
else{
return false;
}
现在
如果jQuery的获得真它会淡入与sucess消息 别的一个div它会褪色在另一个div与错误/遗憾信息
html和JS看起来像这样
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("#submit").click(function(){
$('#submit').attr('disabled',true);
$("#div1").fadeIn(1000); //if success
$("#div2").fadeIn(1000); //if error
});
});
</script>
</head>
<body>
<div id="div1" style="display:none;">Success</div>
<div id="div2" style="display:none;">Error</div>
<button id="submit">report The Page</button>
</body>
</html>
请帮助 日Thnx
你在哪里'
[使用jQuery提交表单](http://stackoverflow.com/questions/1200266/submit-a-form-using-jquery) – vusan