ifeng code relax jquery main page phone Version2
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.9.1.js"></script>
<script type="text/javascript">
//phone ifeng news
var ifeng = {
baseuri:"http://i.ifeng.com",
date:"",
simdata:[],//只顯示標題,就一個
dataS:{
type:"simple",
date:"",
news:[],
},
data:{
date:"",
type:"normal",
types:[],
loopimg:"",
frontnews:[],
tiyu:[],
caijing:[],
},
wrap:function(){
ifeng.init();
ifeng.initLoopimg();
},
init:function(sip){
if(sip){
ifeng.initSimple();
return;
}
ifeng.initDate(sip);
ifeng.initTypes();
ifeng.initDetails();
ifeng.submit(sip);
},
initDate:function(sim){
var d = new Date();
ifeng.date = d.getFullYear()+""+(d.getMonth()+1)+""+d.getDate();
if(sim){
ifeng.dataS.date=ifeng.date;
}else{
ifeng.data.date=ifeng.date;
}
},
submit:function(sip){
var d = "";
if(sip){
d = ifeng.dataS;
}else{
d = ifeng.data;
}
$.ajax({
url:"/testsign/IFengShoujiServlet",
type:'post',
dataType:"json",
async:false,
data:d,
success:function(data){
alert("success");
},
});
},
initSimple:function(){
$("ul.n-t-list li a").each(function(i,n){
var t = {
uri:"",
title:"",
}
t.uri = ifeng.baseuri+$(this).attr("href");
t.title = $(this).text();
ifeng.dataS.news[i] = t;
});
},
initTypes:function(){
$("nav_2014 a").each(function(i,n){
var t = {
uri:"",
title:"",
};
t.uri=ifeng.baseuri+$(this).attr("href");
t.title = $(this).text();
ifeng.data.types[i] = t;
});
},
initDetails:function(){
$("ul.n-t-list").each(function(i,n){
switch (i){
case 0:{
$(this).find("li a").each(function(j,m){
var t = {
uri:"",
title:"",
}
t.uri = ifeng.baseuri+$(this).attr("href");
t.title = $(this).text();
ifeng.data.frontnews[j] = t;
});
break;
}
case 1:{
break;
}
case 2:{//tiyu
$(this).find("li a").each(function(j,m){
var t = {
uri:"",
title:"",
}
t.uri = ifeng.baseuri+$(this).attr("href");
t.title = $(this).text();
ifeng.data.tiyu[j] = t;
});
break;
}
case 7:{
$(this).find("li a").each(function(j,m){
var t = {
uri:"",
title:"",
};
t.uri = ifeng.baseuri+$(this).attr("href");
t.title = $(this).text();
ifeng.data.caijing[j] = t;
});
break;
}
}
});
},
};
</script>
</head>
<body>
<form id="myform" name="myform" action="/testsign/CsdnDataServlet">
<input type="hidden" id="source" value="${source}" />
<input type="hidden" id="types" value="${types}" />
<input type="hidden" id="data" name="data" value="" />
<input type="button" id="test" value="測試語法" onclick="test.abc()">
<input type="button" id="datasubmit" value="開始解析上傳">
<input type="submit" id="mysubmit" value="提交" >
<input type="button" id="testdata" value="測試資料csdn" onclick="savenews.savedata(2,'1')">
<input type="button" id="testdata" value="測試資料zonghe" onclick="savenews.savedata(3,'9')">
<input type="button" id="testdata" value="測試資料phoneifeng" onclick="ifeng.init()">
</form>
</body>
</html>
package com.wj.service.news.shouji;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class IFeng implements Serializable{
private String date;// 格式 20140512
private String type; // normal,simple
private List<HashMap<String, String>> hotNews = new ArrayList<HashMap<String, String>>();
private List<HashMap<String, String>> tiyu = new ArrayList<HashMap<String, String>>();
private List<HashMap<String, String>> yule = new ArrayList<HashMap<String, String>>();
public List<HashMap<String, String>> getHotNews() {
return hotNews;
}
public List<HashMap<String, String>> getTiyu() {
return tiyu;
}
public List<HashMap<String, String>> getYule() {
return yule;
}
List<HashMap<String, String>> simData =
new ArrayList<HashMap<String, String>>();
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public List<HashMap<String, String>> getSimData() {
return simData;
}
public void init() {
if (type != null && type == "simple") {
}
else {
}
}
public void addSimData(HashMap map){
simData.add(map);
}
public void addHotNews(HashMap map){
hotNews.add(map);
}
public void addTiyuNews(HashMap map){
tiyu.add(map);
}
public void addYuleNews(HashMap map){
yule.add(map);
}
}
public void seri(IFeng feng){
try {
ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("D:/serial/"+feng.getDate()+feng.getType()+".obj"));
out.writeObject(feng);
out.close();
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
相關文章
- Codeforces 1017 CThe Phone Number
- LeetCode-Design Phone DirectoryLeetCode
- List all javascript events wired up on a page using jqueryJavaScriptjQuery
- Codeforces 158E Phone Talks:dp
- Relax! It's just a game(排列組合,簡單)GAM
- Leetcode Letter Combinations of a Phone NumberLeetCode
- Leetcode 17 Letter Combinations of a Phone NumberLeetCode
- Leetcode-Letter Combinations of a Phone NumberLeetCode
- Letter Combinations of a Phone Number leetcode javaLeetCodeJava
- 用jquery實現HtmlEncode與HtmlDecodejQueryHTML
- jQuery : ajax獲取Status CodejQuery
- activity_main與fragment_mainAIFragment
- Leetcode – 017. Letter Combinations of a Phone NumberLeetCode
- 用cz-relax 輕鬆配置commit友好的倉庫MIT
- main方法AI
- Main()方法AI
- ORA-00600: internal error code, arguments: [kebm_mmon_main_1], [28],ErrorAI
- ORA-00600: internal error code, arguments: [kebm_mmon_main_1], [28ErrorAI
- InnoDB: Error: space id and page n:o stored in the page?Error
- Windows Phone FAQWindows
- AS執行main()方法報錯:SourceSet with name ‘main‘ not foundAI
- 存檔mainAI
- 2788647047_mainAI
- LeetCode Letter Combinations of a Phone Number(017)解法總結LeetCode
- MySQL data pageMySql
- create-a-page
- Mendix Page Template
- 找不到 main 方法, 請將 main 方法定義為: public static void main(String[] args)AI
- Windows Phone 體驗Windows
- 一個IT愛好者眼中的Windows Phone和Android PhoneWindowsAndroid
- go run main.go undefined? golang main包那點事AIUndefinedGolang
- HTML <main> 標籤HTMLAI
- if __name__==”__main__”:AI
- if __name__ == ‘__main__‘AI
- if __name__=="__main__":AI
- Java——main函式JavaAI函式
- The Main Features of MySQLAIMySql
- Animal Cotroller文件——MainAI