二个基于jquey的全自动完毕与分页,怎么着获得网址icon有哪些可行的主意

获得网址icon,常用最轻易易行的法子正是通过website/favicon.ico来获取,不过鉴于非常多网址都以在页面里面安装favicon,所以此方式比相当多情景都不可用。

复制代码 代码如下:

那是多年来做寻觅引擎写的前台页面,全基于JQuery的ajax完成,包罗电动完毕和活动分页
。数据调换使用的是json格式。
 
 
JS
  1 /**
  2  * @author hyjiacan
  3  */
  4 $(document).ready(function() {
  5     // 页面载入后难题定位到寻觅框中
  6     $(‘#keyword’).trigger(‘focus’);
  7     // 解决开关点击时的虚线框
  8     $(‘#submit’).focus(function() {
  9         $(this).trigger(‘blur’);
 10     });
 11     // 重回当前浏览器名称
 12     var getBrowserName = function() {
 13         var bmap = new Array();
 14         $.each($.browser,
 15         function(k, v) {
 16             bmap.push(k);
 17         });
 18         return bmap[0];
 19     };
 20     // ajax获取下拉列表
 21     var $autocompletelist = $(‘<div/>’);
 22     $autocompletelist.addClass(‘autocompletelist’);
 23
 24     // 自动落成事件管理
 25     var lastVal = ”;
 26     $(‘#keyword’).keydown(function(e) {
 27         // 将回车默许提交更动为ajax提交
 28         if (e.keyCode == 13) {
 29             hideAutoComplete();
 30             $(‘#submit’).trigger(‘click’);
 31             return false;
 32         }
 33     });
 34     var hideAutoComplete = function() {
 35         // 移除自动完毕下拉列表
 36         $(‘#container’).remove($autocompletelist);
 37         $autocompletelist.empty();
 38         $autocompletelist.slideUp(100);
 39     };
 40     $(‘#keyword’).attr(‘onpaste’, function(){
 41         $(this).trigger(‘keyup’);
 42     });
 43     $(‘#keyword’).keyup(function(e) {
 44
 45         if ($(this).val().trim() && $(this).val() == lastVal)
return;
 46         lastVal = $(this).val();
 47
 48         $(‘.autocompletelist span’).remove();
 49         // 自动达成下拉列表定位
 50         var pos = $(‘#keyword’).position();
 51         $autocompletelist.css({
 52             left: pos.left,
 53             top: pos.top + $(‘#keyword’).height()
 54         });
 55         $autocompletelist.empty();
 56         $autocompletelist.show();
 57         // 获取活动完毕音讯
 58         if ($(‘#keyword’).val()) {
 59             // 加上岁月戳,防止卫读取缓存数据
 60             $.getJSON(‘autoComplete’, ‘keyword=’ +
encodeURIComponent($(‘#keyword’).val())+’&dt=’+encodeURIComponent($.now()),
 61             function(data) {
 62                 var suggestion = data.suggestion;
 63                 var len = suggestion.length;
 64                 if (len == 0) return;
 65                 var items = suggestion.items;
 66                 for(var i=0;i<len;i++){
 67                     var k = ‘<em class=”k”>’ +
items[i].keyword + ‘</em>’;
 68                     var r = ‘<em class=”r”>约 ‘ +
items[i].results + ‘ 结果</em>’;
 69                     var item = $(‘<span>’ + k +r +
‘</span>’);
 70                    
 71                     item.click(function(e) {
 72                        
$(‘#keyword’).val($(this).children(‘.k’).text());
 73                         $(‘#submit’).trigger(‘click’);
 74                         hideAutoComplete();
 75                     });
 76                     $autocompletelist.append(item);
 77                 };
 78                 // 增多自动完毕下拉列表到DOM中
 79                 $(‘body’).append($autocompletelist);
 80                 $autocompletelist.slideDown(500);
 81             });
 82         } else {
 83             hideAutoComplete();
 84         }
 85     });
 86
 87     var P = {
 88         //总页数
 89         length: 0,
 90         // current page index
 91         cpi: 1,
 92         setCpi: function(val) {
 93             P.cpi = parseInt(val);
 94         },
 95         // AJAX获取页码对应页面数据
 96         get: function() {
 97             P.setCpi($(this).attr(‘index’));
 98             $(this).parent().children().css(‘background-color’,
”);
 99             $(this).css(‘background-color’, ‘#666’);
100             $.ajax({
101                 url: ‘jpager’,
102                 type: ‘get’,
103                 data: ‘page=’ + P.cpi,
104                 dataType: ‘json’,
105                 success: function(data) {
106                     $(‘#list’).empty();
107                     var len = data.list.length;
108                     var items = data.list.items;
109                    
110                     for(var i=0;i<len;i++){
111                         var $item = $(‘<div/>’);
112                         $item.addClass(‘item’);
113                         var $title = $(‘<a
href=”‘+items[i].url+'”‘+’
target=”_blank”>’+items[i].title+'</a>’);
114                         $title.addClass(‘title’);
115                         var $summary =
$(‘<div/>’).text(items[i].summary);
116                         $summary.addClass(‘summary’);
117                         var $url = $(‘<a
href=”‘+items[i].url+'”‘+’
target=”_blank”>’+items[i].url+'</a>’);
118                         $url.addClass(‘url’);
119                         var $date =
$(‘<span/>’).text(items[i].date);
120                         $date.addClass(‘date’);
121                        
$item.append($title).append($summary).append($url).append($date);
122                         $(‘#list’).append($item);
123                     };
124                     P.split(P.length);
125                 }
126             });
127         },
128         /**
129              *  当分页页面大于12个的时候,暗中认可只呈现前10个页码
130              *    具体施行示例:
131              *    1 2 3 4 5 6 7 8 9 10
132              *   
当在这种情形下点击页码,页前面挪动n个单位(具体单位为将点击页码置于第5个为准),则当前显示的页码改动为(以点击8为例):
133              *    4 5 6 7 8 9 10 11 12 13
134              *    就这样推算
135 */
136         split: function(len) {
137             // 清空原有页码
138             $(‘#page’).html(”);
139             $(‘#page’).append($(‘<span id=”first”
index=”1″>首页</span>’).click(P.get));
140
141             if (P.cpi >= 5) {
142                 if (P.cpi > P.length – 5) {
143                     for (var i = P.length – 9; i <= P.length;
i++) {
144                         $(‘#page’).append($(‘<span index=”‘ + i

唯独即使项目尚未应用jQuery等框架的话,js自个儿又从未那样的函数,大家只可以本身写这样的函数,下边是函数的切实落到实处:

更加好的秘技是透过google提供的劳务来贯彻:

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
“;
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html;
charset=gb2312″>
<title>20060427simulate 163</title>
<script language=”JavaScript” type=”text/JavaScript”>
<!–
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if
((appName==”Netscape”)&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
location.reload();
}
MM_reloadPage(true);
//–>
</script>
<style type=”text/css”>
<!–
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 150%;
color: #003399;
text-decoration: none;
}
a:link {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 150%;
font-weight: normal;
color: #003399;
text-decoration: none;
}
二个基于jquey的全自动完毕与分页,怎么着获得网址icon有哪些可行的主意。a:visited {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 150%;
font-weight: normal;
color: #003399;
text-decoration: none;
}
a:hover {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 150%;
color: #0099FF;
text-decoration: underline;
}
a:active {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 150%;
color: #0099FF;
text-decoration: underline;
}
–>
</style>
</head>
<script language=”javascript”>
/*
author:moonboy
本例中应用onKeyUp事件能够将录入的数码取到。在利用onKeyDown,onKeyPress事件时只是在录入第四个数据时手艺取到第一个数据(i
don’t konw why)。
*/
//var ns = String.fromCharCode(event.keyCode);
function droplist(){
var np= event.keyCode;
if(np==38||np==40){
}
var textv = document.getElementById(“drop”).value; //猎取文本框内的值
textv=textv.toLowerCase(); //全体转成小写
var user = new Array();//初阶化数组用来存款和储蓄页面列表值的成团
var sortUser = new Array();//排序后的数组
var resultuser = new Array();//输出到前台的数组
var vv = document.getElementsByName(“hv”);//页面包车型地铁值
var vvl= vv.length;//页面值的数老总度
//付值将从页面取到的联谊放入user数组
for(var i=0;i<vvl;i++){
user[i]=vv[i].value;
}
sortUser = user.sort();//对数组排序
var rs =new Array();//初阶化符合查询条件的数组
var temp;
var c=0;//符合条件的数组计数
for(var j=0;j<vvl;j++){
temp=queryWord(textv,sortUser[j]);//调用queryWord函数,计算出符合条件的值
if(temp==””){
continue;
}else{
//temp=getSelect(textv,temp);
rs[c]=”<tr id=’tv’ name=’tv’ bgcolor=’#eeeeee’><td
id=’al”+c+”‘ onclick=’onV(“+c+”)’ style=’cursor:pointer’
onmouseover=’alterBg(“+c+”,0)’
onmouseout=’alterBg(“+c+”,1)’>”+getSelect(textv,temp)+”</td></tr>”;
c++;
}
}
resultuser=rs.join(“”);//将书组数据分隔符设为换行符
if(textv.length==0){
resultuser=””;
}
document.getElementById(“p”).innerHTML=”<table width=’150px’
cellpadding=’0′ bgcolor=’#FFFFFF’
cellspacing=’0′>”+resultuser+”</table>”;//将数据打字与印刷到钦定区域
}
function getSelect(obj,objtext){
var ol= obj.length;
var res;
obj=objtext.substring(0,ol);
res=”<b>”+obj+”</b>”+objtext.substring(ol,objtext.length);
return res;
}
function alterBg(j,i){//改换下拉列表鼠标事件颜色
var o = document.getElementById(‘al’+j);
if(i==0)
o.style.backgroundColor =”#FFFFEE”;
else if(i==1)
o.style.backgroundColor =”#eeeeee”;
}
function onV(j){//取得下拉列表点击值
var o = document.getElementById(‘al’+j).innerHTML;
o=o.replace(“<B>”,””);
o=o.replace(“</B>”,””);
document.getElementById(‘drop’).value=o;
}
function queryWord(para,str){//该函数为基于条件查询的结果
var r;
r=str.search(para);
if(r==0){
return str;
}else{
return “”;
}
}
function Search(textv,str){//测试用函数在本例中不利用
//var textv = document.getElementById(“drop”).value;
var r,result; // 注脚变量。
r = str.search(textv); // 查找字符串。
str=str.slice(r,-1);
document.getElementById(“p”).innerHTML=str.substring(0,str.indexOf(”
“));
result=str.substring(0,str.indexOf(“”));
return result;
// 返回 Boolean 结果。
}
var i=0;
var k;
function changeTable(){
var selectLength;
selectLength=document.getElementsByName(“tv”).length;
document.getElementById(“opp”).innerHTML=selectLength;
var keyvalue=event.keyCode;
if(selectLength>0){
if(keyvalue==40){
k=i;
i++;
}
else if(keyvalue==38){
k=i;
i–
};
if(i<0){
i=selectLength-1;
}else if(i>selectLength-1){
i=0;
}
var m = “al”+i;
var n =”al”+k;
if(selectLength==1){
var p = document.getElementById(m);
p.style.backgroundColor=”#ffffee”;
}else{
if(i>=0 && i<selectLength){
var p = document.getElementById(m);
p.style.backgroundColor=”#ffffee”;
}
if(k>=0 && k<selectLength){
var h = document.getElementById(n);
h.style.backgroundColor=”#eeeeee”;
}
if(keyvalue==13){
onV(i);
}
}
}
}
function loadDiv(){
div1.style.visibility=”show”;
div2.style.visibility=”show”;
}
function showBody(){
var div1 = document.getElementById(‘Layer1’);
var div2 = document.getElementById(‘Layer2’);
div1.style.visibility=”hidden”;
div2.style.visibility=”hidden”;
}
</script>
<body>
<div id=”opp”></div>
<div id=”Layer1″ style=”position:absolute; background-color:#000000;
left:0px; top:0px; width:100%; height:650px; filter: alpha(opacity=20);
z-index:1; visibility: hidden;”></div>
<div id=”Layer2″ style=”position:absolute; left:0px; top:150px;
width:100%; height:200px; z-index:2; visibility: hidden;”>
<table align=”center” width=”50%” height=”70″ cellpadding=”0″
bgcolor=”#FFFFFF” cellspacing=”0″ >
<tr>
<td align=”center”><a href=”javascript:void(0)”
onclick=”showBody()”>点击这里for my dear
Gee_gee</a>(Moontoucher’s UI manager)</td>
</tr>
</table> </div><br>
<br>
<br>
<br>
<br>
<input name=”drop” type=”text” id=”drop”
onKeyup=”droplist();changeTable()” >
仿163输入邮件地址自动展现下拉列表(献给最亲密的gee_gee)
<div id=”p” style=”height:100px; width:170px; overflow:auto;
border-width:1px; border-color:#000000 “></div>
<input type=”hidden” id=”hv” name=”hv” value=”123″>
<input type=”hidden” id=”hv” name=”hv” value=”uio”>
<input type=”hidden” id=”hv” name=”hv” value=”lkjl”>
<input type=”hidden” id=”hv” name=”hv” value=”9876″>
<input type=”hidden” id=”hv” name=”hv” value=”123467″>
<input type=”hidden” id=”hv” name=”hv” value=”fghj”>
<input type=”hidden” id=”hv” name=”hv” value=”yutf78″>
<input type=”hidden” id=”hv” name=”hv” value=”王旺”>
<input type=”hidden” id=”hv” name=”hv” value=”cuiliyi”>
<input type=”hidden” id=”hv” name=”hv” value=”呵呵”>
<input type=”hidden” id=”hv” name=”hv” value=”王子复仇记”>
<input type=”hidden” id=”hv” name=”hv” value=”certerly”>
<input type=”hidden” id=”hv” name=”hv” value=”123″>
<input type=”hidden” id=”hv” name=”hv” value=”uio”>
</body>
</html>

  • ‘”>’ + i + ‘</span>’).click(P.get));
    145                     }
    146                 } else {
    147                     var si = P.cpi – 4; //start index
    148                     var ei = P.cpi + 5; // end index
    149                     for (var i = si; i <= ei; i++) {
    150                         $(‘#page’).append($(‘<span index=”‘ + i
  • ‘”>’ + i + ‘</span>’).click(P.get));
    151                     }
    152                 }
    153             } else {
    154                 var ei = P.length > 10 ? 10 : P.length;
    155                 for (var i = 1; i <= ei; i++) {
    156                     $(‘#page’).append($(‘<span index=”‘ + i +
    ‘”>’ + i + ‘</span>’).click(P.get));
    157                 }
    158             }
    159             $(‘#page’).append($(‘<span id=”last” index=”‘ +
    P.length + ‘”>末页</span>’).click(P.get));
    160         }
    161     };
    162
    163     // 在输入框外的地点点击鼠标就遮蔽下拉列表
    164     $(document).click(function(e){
    165         if(e.target.id != ‘keyword’){
    166             hideAutoComplete();
    167         }       
    168     });
    169     // 开始ajax搜索
    170     $(‘#submit’).click(function() {
    171         if ($(‘#keyword’).val().trim() == ”) {
    172             $(‘#page’).slideUp(500);
    173             $(‘#list’).slideUp(300);
    174             $(‘#split’).slideUp(500);
    175
    176             return;
    177         }
    178         $(‘#logo’).hide(1000);
    179         hideAutoComplete();
    180         $.ajax({
    181             url: ‘jsearch’,
    182             type: ‘get’,
    183             data: ‘dt=’ + encodeURIComponent($.now()) + ‘&bs=’ +
    encodeURIComponent(getBrowserName()) + ‘&keyword=’ +
    encodeURIComponent($(‘#keyword’).val().trim()),
    184             dataType: ‘json’,
    185             success: function(data) {
    186                 $(‘#split’).slideDown(500);
    187                
    $(‘#kw_result’).text($(‘#keyword’).val().trim());
    188                
    189                 var list = data.list;
    190                 var len = data.length;
    191                 $(‘#list_length’).text(len);
    192                
    193                 if (len == 0) {
    194                     return;
    195                 }
    196                 var items = list.items;
    197                 $(‘#list’).empty();
    198                 for(var i=0;i<list.length;i++){
    199                     var $item = $(‘<div/>’);
    200                     $item.addClass(‘item’);
    201                     var $title = $(‘<a
    href=”‘+items[i].url+'”‘+’
    target=”_blank”>’+items[i].title+'</a>’);
    202                     $title.addClass(‘title’);
    203                     var $summary =
    $(‘<div/>’).text(items[i].summary);
    204                     $summary.addClass(‘summary’);
    205                     var $url = $(‘<a href=”‘+items[i].url+'”‘+’
    target=”_blank”>’+items[i].url+'</a>’);
    206                     $url.addClass(‘url’);
    207                     var $date =
    $(‘<span/>’).text(items[i].date);
    208                     $date.addClass(‘date’);
    209                    
    $item.append($title).append($summary).append($url).append($date);
    210                     $(‘#list’).append($item);
    211                 };
    212
    213                 $(‘#list’).show();
    214                 P.length = Math.ceil(len / 10);
    215                 P.setCpi(1);
    216                 P.split();
    217             }
    218         });
    219     });
    220 });

复制代码 代码如下:

代码:

CSS
* {
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 14px;
    border: 0;
}

//供使用者调用
function trim(s){
return trimRight(trimLeft(s));
}
//去掉侧边包车型地铁空白
function trimLeft(s){
if(s == null) {
return “”;
}
var whitespace = new String(” \t\n\r”);
var str = new String(s);
if (whitespace.indexOf(str.charAt(0)) != -1) {
var j=0, i = str.length;
while (j < i && whitespace.indexOf(str.charAt(j)) != -1){
j++;
}
str = str.substring(j, i);
}
return str;
}
//去掉左侧的空白
function trimRight(s){
if(s == null) return “”;
var whitespace = new String(” \t\n\r”);
var str = new String(s);
if (whitespace.indexOf(str.charAt(str.length-1)) != -1){
var i = str.length – 1;
while (i >= 0 && whitespace.indexOf(str.charAt(i)) != -1){
i–;
}
str = str.substring(0, i+1);
}
return str;
}

复制代码 代码如下:

body {
    min-width: 640px;
}

利用时只需调用trim函数就能够。
上面是用正则的贯彻格局:

<!doctype html>
<html>

#JSearch {
    width: 600px;
    margin-top: 20px;
}

复制代码 代码如下:

<head>
<meta charset=”utf-8″>
<style type=”text/css”>
#input {
height: 300px;
padding: 10px 5px;
line-height: 20px;
width: 1000px;
}
#submit {
height: 30px;
text-align: center;
color: #ffffff;
line-height: 30px;
width: 80px;
background-color: blue;
margin-top: 20px;
}
#result {
margin-top: 20px;
}
#result li {
height: 40px;
line-height: 40px;
float: left;
margin: 10px 14px;
}
</style>
</head>

#keyword {
    width: 480px;
    height: 32px;
}

<SCRIPT LANGUAGE=”JavaScript”>
<!–
String.prototype.Trim = function()
{
return this.replace(/(^\s*)|(\s*$)/g, “”);
}
String.prototype.LTrim = function()
{
return this.replace(/(^\s*)/g, “”);
}
String.prototype.RTrim = function()
{
return this.replace(/(\s*$)/g, “”);
}
//–>
澳门葡京 ,</SCRIPT>
<input type=”text” value=”    前后都以空格   ” id=”space”>
<input type=”button” value=”去前后空格”
onclick=”javascript:document.getElementById(‘space’).value=document.getElementById(‘space’).value.Trim();document.getElementById(‘space’).select();”>
<input type=”button” value=”去前空格”
onclick=”javascript:document.getElementById(‘space’).value=document.getElementById(‘space’).value.LTrim();document.getElementById(‘space’).select();”>
<input type=”button” value=”去后空格”
onclick=”javascript:document.getElementById(‘space’).value=document.getElementById(‘space’).value.RTrim();document.getElementById(‘space’).select();”>
<input type=”button” value=”还原”
onclick=”javascript:document.getElementById(‘space’).value=’   
前后都以空格     ‘;”>

<body>
<textarea id=”input”
placeholder=”输入四个网站以空格间隔”></textarea>
<div id=”submit”>获取icon</div>
<ul id=”result”>

#submit {
    width: 100px;
    height: 32px;
}

上边的代码因为编辑器的难点,空格被沟通了,所以我们请细心增多空格,测验。

</ul>

input {
    font-size: 1.5em;
    line-height: 1.5em;
    height: 1.5em;
    border: solid #ccc 1px;
}

复制代码 代码…

<script type=”text/javascript”>
var input = document.getElementById(“input”);
var submit = document.getElementById(“submit”);
var result = document.getElementById(“result”);
var val;

#submit {
    cursor: pointer;
    background-color: #DDDDDD;
}

function trim(str) {
var whitespace = ‘
\n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000’;
for (var i = 0, len = str.length; i < len; i++) {
if (whitespace.indexOf(str.charAt(i)) === -1) {
str = str.substring(i);
break;
}
}
for (i = str.length – 1; i >= 0; i–) {
if (whitespace.indexOf(str.charAt(i)) === -1) {
str = str.substring(0, i + 1);
break;
}
}
return whitespace.indexOf(str.charAt(0)) === -1 ? str : ”;
}

#submit:hover, #submit:focus {
    background-color: #666666;
    color: #cccccc;
}

function getFavIconUrl(url) {
var prohost;
prohost = url.match(/([^:\/?#]+:\/\/)?([^\/@:]+)/i);
prohost = prohost ? prohost : [true, “http://”,
document.location.hostname];

.center {
    margin: 20px auto;
    display: block;
}

//补全url
if (!prohost[1]) {
prohost[1] = “http://”;
}
//抓取ico
return “” + prohost[1] +
prohost[2];
}
submit.onclick = function() {
val = input.value;
if (!val) alert(“输入为空!”);
val = val.split(” “);
val.forEach(function(item) {
item = trim(item);
if (!item) return;
result.innerHTML += “<li>” + item + “<img src='” +
getFavIconUrl(item) + “‘></li>”;
});
};
</script>
</body>
</html>

.autocompletelist {
    background-color: #FFFFFF;
    width: 480px;
    height: auto;
    font-size: 1.2em;
    line-height: 1.2em;
    border: 1px solid #AAAAAA;
    position: absolute;
    display: none;
}

源代码下载.rar)

.autocompletelist span {
    display: block;
    padding: 2px 2px;
}

.autocompletelist span:hover, .dropdownlist span:focus {
    background-color: #DDDDDD;
    cursor: pointer;
    font-weight:bold;
}
.autocompletelist .r {
    float:right;
    margin-right:10px;
}

#split {
    margin: 10px auto;
    padding: 2px 20px;
    color: #3333FF;;
    vertical-align:middle;
    background-color: #eeeeee;
    font-size: 1em;
    line-height: 1em;
    display: none;
    text-align:right;
}
#split em{
    font-weight:bold;
}
#list {
    margin: 20px 40px;
}

#list div {
    margin: 2em auto;
}

#page {
    margin: 20px 5px;
    text-align: center;
}

#page span {
    cursor: pointer;
    font-size: 1.2em;
    line-height: 1.2em;
    margin: 0 2px;
    padding: 6px 8px;
    background-color: #DDDDDD;
    border: solid 1px #AAAAAA;
}

#page span:hover, #page span:focus {
    background-color: #BBBBBB;
    border: solid 1px #AAAAAA;
}

#list {
    width:800px;
    margin:0 auto;
    background-color: #FAFAFA;
}
#list a, #list a:visited{
    color:#0000FF;
    text-decoration:none;
}
#list .item{
    border-top:5px solid #FFFFFF;
    border-bottom:5px solid #FFFFFF;
    margin:0px auto;
}
#list .title{
    font-size:1.2em;
    line-height:1.2em;
}
#list .title:hover {
    color:#FF0000;
}
#list .summary{
    font-size:0.8em;
}
#list .url{
    background-color: #F3F3F3;
}
#list .date{
    float:right;
    clear:both;
}

HTML页面
<!DOCTYPE HTML>
<html>
    <head>
        <meta type=”Content-Type”
content=”text/html;charset=UTF-8″>
        <title>Search – Just search</title>
        <link rel=”stylesheet” type=”text/css”
href=”css/jsearch.css”>
        <link rel=”stylesheet” type=”text/css”
href=”css/result.css”>
        <script type=”text/javascript”
src=”js/jquery-1.6.2.min.js”></script>
        <script type=”text/javascript” src=”js/jsearch.js”
charset=”UTF-8″></script>
    </head>

    <body>
        <div class=”center”>
            <img class=”center” id=”logo” src=”image/jsearchlogo.png”
alt=”Just search” />
            <form class=”center” id=”JSearch”>
                <input type=”text” id=”keyword” name=”keyword”
maxlength=”80″
                    value=”” autocomplete=”off” />
                <input type=”button” id=”submit” value=”JSearch”
/>
            </form>
        </div>
        <div id=”split” class=”center”>
            Search for “
            <em id=”kw_result”></em>
            “, about
            <span id=”list_length”></span>
            results.
        </div>
        <div id=”list” class=”center”></div>
        <div id=”page” class=”center”></div>
    </body>
</html>

 

摘自  hyjiacan 

。数据沟通使用的是json格式。 JS 1 /** 2 * @author hyjia…

相关文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注

*
*
Website