码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2016-11-06 16:27:36      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:style   ade   alt   nbsp   分享   contents   技术   span   技术分享   

技术分享

<!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特性实现无刷新点击了

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

标签:style   ade   alt   nbsp   分享   contents   技术   span   技术分享   

原文地址:http://www.cnblogs.com/leigood/p/6035202.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!