数据库表: 复制内容到剪贴板
代码:
create table `xqbar`.`suggest` (
`id` int not null auto_increment ,
`title` varchar( 100 ) not null ,
`hits` int not null default 0,
primary key ( `id` )
) engine = innodb
insert into suggest(title,hits)values(xqbar.com,100);
insert into suggest(title,hits)values(www.xqbar.com,410);
insert into suggest(title,hits)values(http://xqbar.com,700);
insert into suggest(title,hits)values(mail:xqbar.com,200);
insert into suggest(title,hits)values(ftp:xqbar.com,100);
insert into suggest(title,hits)values(http://www.xqbar.com,70)search.php
(关于php我也是接触不久,下面的php如果罗嗦还望高手指点)
返回的信息字符串要为 xxx1|xxx2$200|100 前后对应 复制内容到剪贴板
代码:
js代码 复制内容到剪贴板
代码:
引入prototye.js有朋友说这个库太大,或者把,不习惯的朋友可以使用jquery.js框架或者直接创建ajax对象,这个我就不想说了,这里直接引用prototye.js框架
创建层和显示查询结果的js代码
var listframe=document.createelement(iframe);
listframe.id=rframe;
listframe.style.zindex=1;
listframe.style.position=absolute;
listframe.style.border=0;
listframe.style.display=none;
listframe.style.width=$(keyword).clientwidth+px;
listframe.style.left=getposition($(keyword),offsetleft)+1+px;
listframe.style.top =(getposition($(keyword),offsettop)+$(keyword).clientheight +3)+px;
document.body.appendchild(listdiv);
document.body.appendchild(listframe);
}
function setstyle(element,classname)
{
switch (classname)
{
case m:
element.style.fontsize=12px;
element.style.fontfamily=arial,sans-serif;
element.style.backgroundcolor=#3366cc;
element.style.color=black;
element.style.width=$(keyword).clientwidth-2+px;
element.style.height=20px;
element.style.padding=1px 0px 0px 2px;
if(element.displayspan)element.displayspan.style.color=white
break;
case d:
element.style.fontsize=12px;
element.style.fontfamily=arial,sans-serif;
element.style.backgroundcolor=white;
element.style.color=black;
element.style.width=$(keyword).clientwidth-2+px;
element.style.height=20px;
element.style.padding=1px 0px 0px 2px;
if(element.displayspan)element.displayspan.style.color=green
break;
case t:
element.style.width=80%;
if(window.navigator.useragent.tolowercase().indexof(firefox)!=-1)element.style.cssfloat=left;
else element.style.stylefloat=left;
element.style.whitespace=nowrap;
element.style.overflow=hidden;
element.style.textoverflow=ellipsis;
element.style.fontsize=12px;
element.style.textalign=left;
break;
case h:
element.style.width=20%;
if(window.navigator.useragent.tolowercase().indexof(firefox)!=-1)element.style.cssfloat=right;
&nb
http://www.bkjia.com/phpjc/486599.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/486599.htmltecharticle数据库表: 复制内容到剪贴板 代码: create table `xqbar`.`suggest` ( `id` int not null auto_increment , `title` varchar( 100 ) not null , `hits` int not null default 0...