<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link href="index.css" type="text/css" rel="stylesheet">
<title>桃花官网移动端首页</title>
</head> <body>
<div class="wrap">
<!--头部-->
<div id="header">
<div class="top_bar">
<a class="register" href="/index.html">&lt;返回</a>
<img src="public/images/news/news_tit.png" class="news_tit">
<div class="nav">
<img src="public/images/index/nav_icon.png">
</div>
<!--导航展开-->
<div class="child_nav">
<a href="#" class="bt_no">新闻</a>
<a href="#">特色</a>
<a href="#">职业</a>
<a href="#">攻略</a>
<a href="#" class="bb_no">论坛</a>
</div>
</div>
</div>
<!--新闻公告-->
<div class="news_info">
<ul class="list">
<li>
<a href="#">
<img src="public/images/index/z_x.png" border="0">
<div>至尊争霸赛决战圣诞夜 登陆送豪礼</div>
</a>
</li>
<li>
<a href="#">
<img src="public/images/index/x_w.png" border="0">
<div>新服"天涯初雪"今日12:00温馨开启</div>
</a>
</li>
<li>
<a href="#">
<img src="public/images/index/g_g.png" border="0">
<div>2014年12月19日Ver0.7.500-Ver0.7.501版本...</div>
</a>
</li>
<li>
<a href="#">
<img src="public/images/index/z_t.png" border="0">
<div>圣诞大作战 大礼享不停!</div>
</a>
</li>
<li>
<a href="#">
<img src="public/images/index/m_t.png" border="0">
<div>【CBI游戏天地】桃花鬼马万圣节</div>
</a>
</li>
<li>
<a href="#">
<img src="public/images/index/z_x.png" border="0">
<div>至尊争霸赛决战圣诞夜 登陆送豪礼</div>
</a>
</li>
<li>
<a href="#">
<img src="public/images/index/x_w.png" border="0">
<div>新服"天涯初雪"今日12:00温馨开启</div>
</a>
</li>
<li>
<a href="#">
<img src="public/images/index/g_g.png" border="0">
<div>2014年12月19日Ver0.7.500-Ver0.7.501版本...</div>
</a>
</li>
<li>
<a href="#">
<img src="public/images/index/z_t.png" border="0">
<div>圣诞大作战 大礼享不停!</div>
</a>
</li>
<li>
<a href="#">
<img src="public/images/index/m_t.png" border="0">
<div>【CBI游戏天地】桃花鬼马万圣节</div>
</a>
</li>
</ul>
<!--<a href="#" class="more">查看更多></a>-->
</div>
<a href="#" id="more">下拉加载!</a><!--分享到-->
<div id="share_box">
<h2 class="share_tit">分享到</h2>
<a href="#"><img src="public/images/index/w_x.jpg" border="0"></a>
<a href="#"><img src="public/images/index/t_x.jpg" border="0"></a>
<a href="#"><img src="public/images/index/x_l.jpg" border="0"></a>
<a href="#"><img src="public/images/index/k_j.jpg" border="0"></a>
<a href="#"><img src="public/images/index/p_y.jpg" border="0"></a>
</div>
<!--联系方式-->
<div id="contact">
<p><img src="public/images/index/pc.jpg" border="0" class="pc"><a href="http://www.leyoo.com/" target="_blank" class="pc_web">查看PC版本官网</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="public/images/index/telephone.jpg" border="0" class="telephone">客服电话:0755—86671177</p>
</div>
<!--版权信息-->
<div id="footer">
<p>出版号:ISBN 978-7-900267-12-2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;文网游备字[2011]C-RPG057号<br>粤网文[2013]0832-232号&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;增值电信业务经营许可证粤B2-20100197号<br>粤ICP备10046641号</p>
</div>
<!--返回顶部-->
<a class="return_top" href="javascript:void(0);"><img src="public/images/index/return_top.png" border="0"></a>
</div>
<script src="jquery-1.7.2.min.js"></script>
<script>
$(function(){
var timer;
$(window).scroll(function(){
  var scrollTop = $(this).scrollTop();
  var scrollHeight = $(document).height();
  var windowHeight = $(this).height();
  go_scroll(scrollTop,scrollHeight,windowHeight);
}); function go_scroll(scrollTop,scrollHeight,windowHeight){
//下拉事件触发
window.clearInterval(timer);
timer=setTimeout(function(){
if(scrollTop + windowHeight >= scrollHeight-60){
$("#more").html("加载中~")
       //$.get和$.post没有请求失败处理,如要其他请求状态处理用$.ajax
$.get("aa.xml",function(data,status){
$("#more").html("下拉加载~");
//模拟数据json
var employees ='{ "employees" : [' +
'{ "a_href":"Bill" , "img_src":"Gates" , "content":"11111" },' + '{ "a_href":"Bill" , "img_src":"Gates" , "content":"222222" },' + '{ "a_href":"Bill" , "img_src":"Gates" , "content":"33333" },' +
'{ "a_href":"George" , "img_src":"Bush" , "content":"44444" },' +
'{ "a_href":"Thomas" , "img_src":"Carter" , "content":"55555" } ]}';
var obj = eval ("(" + employees + ")");
write_ajax(obj);
}
)
  }},500);
}
function write_ajax(obj){
if(jQuery.isEmptyObject( obj )){$("#more").html("没有内容了~"); return false};
var li_list = [],
a_list = [],
img_list = [],
div_list = [],
ajax_list=[];
$(obj.employees).each(function(i){//如果需要只进行一次页面重构就要拼写成字符串一次性append进去
li_list[i] = document.createElement("li"),
a_list[i] = document.createElement("a"),
img_list[i] = document.createElement("img"),
div_list[i] = document.createElement("div"),
a_list[i].setAttribute("href",obj.employees[i].a_href);
div_list[i].innerHTML=obj.employees[i].content;
img_list[i].setAttribute("src",obj.employees[i].img_src);
a_list[i].appendChild(img_list[i]);
a_list[i].appendChild(div_list[i]);
li_list[i].appendChild(a_list[i]);
$(".list").append(li_list[i]);
})
};
})
</script>
</body>
</html>

ajax的项目实操(只用于记录部分文件未引入)的更多相关文章

  1. 使用Jenkins与Docker持续集成与发布NetCore项目(实操篇)

    使用Jenkins与Docker持续集成与发布NetCore项目(教程一) 原文地址:https://www.cnblogs.com/Jackyye/p/12588182.html 基本环境 该教程的 ...

  2. Linux基础实操二

    实操一: 1) 新建用户natasha uid为1000,gid为555,备注信息为“master” 2) 修改natasha用户的家目录为/Natasha 3) 查看用户信息配置文件的最后一行 ca ...

  3. 南方IT学校期末PCB结课项目考试(实操)说明书

    南方IT学校期末结课项目考试(实操)说明书(一) 课程:<印制电路板设计技术>(二) 项目:笔记本电脑电源适配器的印制电路板设计(三) 背景说明:如今笔记本已经进入千家万户,作为给电脑充电 ...

  4. 从零实操基于WSL2 Docker部署Asp.Net Core项目

    前言 平日在公司里都是基于阿里Teambition中的飞流进行Docker部署Api项目或服务,已经习惯了那一套成熟的操作流程,开发和部署确实快捷方便,但是还没在自己的电脑上进行操作过,特别是Wind ...

  5. SFUD+FAL+EasyFlash典型场景需求分析,并记一次实操记录

    SFUD+FAL+EasyFlash典型场景需求分析:用整个flash存储数据,上千条数据,读取得时候用easyflash很慢,估计要检索整个flash太慢了. 改进方法:分区检索. 1存数据时,根据 ...

  6. ubuntu 18.04 搭建flask服务器(大合集,个人实操)

    ubuntu 18.04 搭建flask服务器(大合集) Ubuntu python flask 服务器 本次使用的Ubuntu版本为:Ubuntu 18.04.5 LTS (GNU/Linux 4. ...

  7. [Django框架 - 静态文件配置、request对象方法初识、 pycharm链接数据库、ORM实操增删改查、django请求生命周期]

    [Django框架 - 静态文件配置.request对象方法初识. pycharm链接数据库.ORM实操增删改查.django请求生命周期] 我们将html文件默认都放在templates文件夹下 将 ...

  8. RFC2889广播时延测试——网络测试仪实操

    一.简介 RFC 2889为LAN交换设备的基准测试提供了方法学,它将RFC 2544中为网络互联设备基准测试所定义的方法学扩展到了交换设备,提供了交换机转发性能(Forwarding Perform ...

  9. CS内网横向移动 模拟渗透实操 超详细

    @Webkio 前言: 最近在跟朋友搞一些项目玩,所以最近没怎么更新内容接下来我将在虚拟中模拟内网多层靶场,进行内网渗透实验,超详细,适合小白.本文仅供网安学习,不可利用于未授权渗透工作中,否则后果自 ...

随机推荐

  1. Git之”make sure you have the correct access…”

    git 命令在windows下无法使用pull.fetch.push等命令,提示 “please make sure you have the correct access and the repos ...

  2. 【转】如何将ACCESS数据库后缀名accdb改为mdb

    office 2007中的ACCESS数据库保存时,默认的后缀名是*.accdb, 但是在数据库编程中,用到的后缀名却是*.mdb, 不能直接将后缀名由 accdb 改为 mdb,虽然没有出错,但是编 ...

  3. MySql 安装过程(摘自网络)

    下面的是MySQL安装的图解,用的可执行文件安装的,详细说明了一下! 打开下载的mysql安装文件mysql-5.0.27-win32.zip,双击解压缩, 运行“setup.exe”,出现如下界面 ...

  4. sharepoint代码添加WebPart

    Adding a web part   Following code snippet can be used to add a web part in an existing SharePoint w ...

  5. 安装TensorFlow的步骤

    安装步骤: 1.安装虚拟机: 2.安装liunx系统: 3.安装TensorFlow. 1.安装虚拟机:虚拟机的版本是不能太低的.我使用的是:VMware-workstation-full-12.0. ...

  6. Windows Server2012上使用Nginx做文件服务器

    由于项目中用到了大量的文件上传和删除,考虑到安全的因素,所以整体的思路是使用FTP从主服务器把文件资源上传到文件服务器上. FTP上传到服务器的代码如下(简单附加一下,具体的网上很多) public ...

  7. spring的校验框架 @Validated & BindingResult

    controller上写法类似这样: @RequestMapping(value = "saleInfoList.json", method = RequestMethod.GET ...

  8. 字符串:"2016-09-21T18:57:50+08:00[Asia/Chungking]" 转Date

    public static void main(String[] args) throws Exception { Date date1 = new Date(); SimpleDateFormat ...

  9. ACM常用模板

    数论: 中国剩余定理(互质与非互质通用版) ],r[]; int e_gcd(int a,int b,int &x,int &y) { ) { x=; y=; return a; } ...

  10. android自定义控件(理论知识学习 +自定义属性的讲解)

    View树和UI界面架构图   UI界面架构图: android视图最外层是一个window对象. phoneWindow来实现. phoneWindow将一个decorView作为整个布局的根vie ...