HTML代码:

---------------------------------------------------------------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> TEST </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<script type="text/javascript" src="jquery-1.2.6.pack.js"></script>
<script type="text/javascript">
<!--
$(document).ready( function () {
$('#btn').click ( function () {
    $.ajax({
    url: 'http://localhost/1.php',
    type: 'POST',
    data:'name='+$('#name').val(),
    dataType: 'html',
    timeout: 1000,
    error: function(){
     alert('Error loading XML document');
    },
    success: function(html){
     $('#text').html(html);
    }
    });
});
})
//-->
</script>
</head>

<body>
<div ></div>
<input type="text" />
<input type="button" value="DO IT ." />
</body>
</html>

---------------------------------------------------------------------------

1.PHP代码

---------------------------------------------------------------------------

<?php
$name = $_POST['name'];
echo "you say : ".$name;

?>

---------------------------------------------------------------------------



相关文章:

  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
  • 2022-02-05
  • 2021-08-31
  • 2021-11-07
  • 2021-12-12
猜你喜欢
  • 2022-02-08
  • 2021-05-21
  • 2022-02-26
  • 2021-12-31
  • 2022-02-28
  • 2021-09-12
相关资源
相似解决方案