29,031
社区成员
发帖
与我相关
我的任务
分享
//
// ViewController.swift
// Fuer
//
// Created by Summer. on 15/6/8.
// Copyright (c) 2015年 Summer. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var wv: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
wv.loadRequest(NSURLRequest(URL: NSURL(string: "http://127.0.0.1:8080/fuwuwaibao/mobile.jsp")!))
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type="text/css">
*{
margin: 0;
padding: 0;
}
body{
margin: 0;
padding: 0;
width:640px;
height:960px;
}
.main {
width:640px;
height:960px;
overflow: hidden;
background-image: url(bg.jpg);
}
ul.message-box {
width: 640px;
height: 600px;
margin-top: 200px;
}
li.message-item {
width: 640px;
height: auto;
padding-left: 55px;
padding-right: 55px;
margin-top: 20px;
text-align: left;
font-size: 16px;
color: #999;
}
</style>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$().ready(function(){
setInterval(function(){
$.getJSON("GetMsgServlet?flag=mo",function(data){
$(".message-box").prepend(
"<li class='message-item'><span class='time'>"+
data.message.msg_time+
" </span>"+
data.message.msg_company+
"</li>");
});
},1000);
});
</script>
</head>
<body>
<div class="main">
<ul class="message-box">
<li class="message-item"><span class="time">12:45 </span>菊花实业集团回复了你的简历</li>
<li class="message-item"><span class="time">12:45 </span>菊花实业集团回复了你的简历</li>
<li class="message-item"><span class="time">12:45 </span>菊花实业集团回复了你的简历</li>
</ul>
</div>
</body>
</html>