This Domain(Admin5.com) is for Sale:

js技巧收集(200多个)

时间:2007-12-27  来源:不详  作者:林子

<%
String str = "print me";
//always give the path from root. This way it almost always works.
String nameOfTextFile = "/usr/anil/imp.txt";
try
{
PrintWriter pw = new PrintWriter(new FileOutputStream(nameOfTextFile));
pw.println(str);
//clean up
pw.close();
}
catch(IOException e)
{
out.println(e.getMessage());
}
%>
dedecms.com

52.先读文件再写文件
<%@ page language = "java" %>
<%@ page contentType = "text/html; charSet=gb2312" %>
<%@ page import ="java.util.*" %>
<%@ page import ="java.lang.*" %>
<%@ page import ="javax.servlet.*" %>
<%@ page import ="javax.servlet.jsp.*" %>
<%@ page import ="javax.servlet.http.*" %>
<%@ page import="java.io.*" %>
eryrytry
<%
int count=0;
FileInputStream fi =new FileInputStream ("count.txt");
ObjectInputStream si= new ObjectInputStream (fi);
count =si.readInt();
count ;
out.print(count);
si.close();

copyright dedecms

FileOutputStream fo =new FileOutputStream ("count.txt");
ObjectOutputStream so= new ObjectOutputStream (fo);
so.writeInt(count);
so.close();
%>

织梦好,好织梦

53.直线型输入框
<INPUT name=Password size=10 type=password style="border-left-width: 0; border-right-width: 0; 织梦好,好织梦

border-top-width: 0; border-bottom-style: solid; border-bottom-width: 1; background-color: #9CEB9C">

本文来自织梦

54.可以将背景改为按钮性状,通过改变css改变属性
<td width="65" align="center" bgcolor="#E0E0E0" onmouseover=this.className='mouseoverbt';

dedecms.com

onmouseout=this.className='mouseout';><a href="tm.asp?classid=76"><font 本文来自织梦

color="#000000">录音笔</font></a></td>
<style>
.mouseoverbt
{
background-image: url(http://www.yongle.com.cn/img/btbgw64h20y.gif);
background-repeat: no-repeat;
}
.mouseout
{
background-color: #E0E0E0;
}
</style> 织梦好,好织梦

55.同时按下CTRL和Q键
document.onkeydown=function()
{
if(event.ctrlKey&&event.keyCode==81)
{alert(1)}
}// 织梦内容管理系统

56.以下是一个完整的显示hint的代码,其思想是当鼠标停留是将div中的内容显示在鼠标出,当鼠标移出后在将该div隐

织梦内容管理系统

藏掉
---------------------------------------------------------------------------------------------------------

织梦内容管理系统

------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<style>
#hint{
width:198px;
border:1px solid #000000;
background:#99ff33;
position:absolute;
z-index:9;
padding:6px;
line-height:17px;
text-align:left;
top: 1520px;
}
</style>
<SCRIPT LANGUAGE="JavaScript">
<!--
function showme()
{
var oSon=window.document.getElementById("hint");
if (oSon==null) return;
with (oSon)
{
innerText=guoguo.value;
style.display="block";
style.pixelLeft=window.event.clientX window.document.body.scrollLeft 6;
style.pixelTop=window.event.clientY window.document.body.scrollTop 9;
}

看完这篇,您有何感觉呢?

文章评论

共有位Admini5网友发表了评论 查看完整内容

24小时热门信息