博文
[JavaScript]调用搜索引擎进行搜索示例(2006-11-25 23:33:00)
摘要:
示例演示:http://scboy.ik8.com/CallSearch.htm
<!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=gb2312">
<title>CallSearch</title>
<script language="javascript">
// 处理输入的字符串,用+号代替空格
function search()
{
var zfc = document.eingabe.searchtext.value;
var searchword = "";
for ( var i = 0; i < zfc.length; i++ )
{
// 获得一个字符
var char = zfc.substring( i, i+1 );
// 判断是否为空格
if ( char == " " )
{
searchword += "+"; // 连接一个加号
}
else
{
searchword += char; // 连接字符<......
[JavaScript]网页背景色渐变(2006-11-22 12:33:00)
摘要:
示例演示:http://scboy.ik8.com/ColorInOut.htm
<!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=gb2312">
<title>ColorInOut</title>
<script language="javascript">
hexa = new Array(16);
for ( var i = 0; i < 10; i++ )
{
hexa[i] = i;
}
hexa[10] = "a";
hexa[11] = "b";
hexa[12] = "c";
hexa[13] = "d";
hexa[14] = "e";
hexa[15] = "f";
// 产生16进制数
function hex(i)
{
if ( i < 0 )
return "00";
else if ( i > 255 )
return "ff";
&nb......
[JavaScript]跑马灯示例(2006-11-21 19:08:00)
摘要:
示例演示:http://scboy.ik8.com/RandomRunHouse.htm
<!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=gb2312">
<title>RandomRunHouse</title>
<script language="javascript">
msgArray = new Array(4);
msgArray[0] = "欢迎光临";
msgArray[1] = "白日依山静,黄河入海流";
msgArray[2] = "人道是,三国周郎赤壁";
msgArray[3] = "EmailTo: kof_he@163.com";
var msg = "";
var flag = true;
var addOne = 1;
var space = 50;
var addTwo = 0;
function randomMessage()
{
// 判断次句跑马灯是否跑完,跑完则重新随机获得语句
if ( flag == true )
{
// 随机获得状态栏显示语句
&......