AJAX-----01远古时期的ajax

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ajax</title>
</head>
<body>
    <div>
        <p>红烧牛肉</p>
        <p><a href="1.php">投票</a></p>
    </div>
</body>
</html>

 

 

 

 

 

<?php
    $con = file_get_contents('1res.txt');
    $con += 1;
    file_put_contents('1res.txt',$con);
    //利用http协议的204特性
    header('HTTP/1.1 204 No Contents');

 

 

这样即可利用http协议的204特性实现无刷新点击了

posted @ 2016-11-06 13:59  夺命雷公狗  阅读(215)  评论(0编辑  收藏  举报