本 站 搜 索 |
分 类 列 表 |
文 章 阅 读 排 行 |
|
 |
Javacript 简介 |
|
1228 |
2007-12-24 |
Javacript 是一种能让你的网页更加生动活泼的程式语言,也是目前网页中设计中最容易学又最方便的语言。
你可以利用 Javacript 轻易的做出亲切的欢迎讯息、漂亮的数字钟、有广告效果的跑马灯及简易的选举,还可以显示浏览器停留的时间。让这些特殊效果提高网页的互动性、提供亲切的服务,让你的.. |
|
 |
定位表单时出现提示文字 |
|
1684 |
2007-07-09 |
style type="text/css"*{margin:0px;padding:0px;font-size:12px;}input{width:100px;height:20px;border:1px solid #ccc;}/style
script language="javascript"function tips(id,str) {var l=document.getElementById(id).offsetLeft+120;var t=document.getElementById(id).offsetTop;document.get.. |
|
 |
用 ajax 写仿 google search suggest 的搜索提示 |
|
5734 |
2007-07-09 |
无聊的时候写的,也没什么精练和安全可言,纯是为了好玩....而且我也没有像GOOGLE那样去考虑JS文件大小等等各种因素,我的目的是能实现能玩就可以了.呵呵.....
主要原理是这样:每次用户输入,就自动发送搜索的关键字到服务器端,如果有相关的已设定好的搜索,则返回到客户端.而客户端再通过DOM进行动态.. |
|
 |
仿 Google 输入表单的提示可选择的文字 |
|
2881 |
2007-07-09 |
meta http-equiv="Content-Type" content="text/html; charset=utf-8" /script
function suckerfish(type, tag, parentId){if (window.attachEvent){window.attachEvent("onload", function(){var sfEls = (parentId==null)?
document.getElementsByTagName(tag):document.getElementById(parentId).. |
|
 |
一个表单两个提交按钮 |
|
1706 |
2007-07-09 |
Script Language="JavaScript"!--function submitit1() {document.myForm.action="cgi1.php"document.myForm.submit();}
function submitit2() {document.myForm.action="cgi2.php"document.myForm.submit();}//-/Script
form name="myForm" METHOD="post"username:input type=text name=text1pass.. |
|
 |
表单提交后按钮即失效 |
|
1886 |
2007-07-09 |
Script Language="JavasSript" !--function checkform() {test.submit.disabled=true;}//--/Scriptform action="1.asp" name="test" onsubmit="return checkform();"input type="submit" name="submit"/form
form action="0.asp" onsubmit="this.sub.disabled=true;" input type="submit" name="sub".. |
|
 |
显示表单中已输入的字数 |
|
2659 |
2007-06-06 |
textarea name="t" rows="5" cols="50" onpropertychange="c.value = value.match(/[^ -~]/g) == null ? value.length : value.length + value.match(/[^ -~]/g).length"/textareabr已输入字数:input name="c" |
|
 |
检测表单提交时的提示信息 |
|
1778 |
2007-06-06 |
Script Language="JavaScript"!--function CheckForm() {if (document.SendMail.M_Email.value=="") {//SendMail.M_Email.value="必须填写收信人邮箱地址...";//alert("必须填写收信人邮箱地址...");//EM_M_Email.innerText="font color=#FF0000必须填写收信人邮箱地址/font"EM_M_Email.innerHTML="fo.. |
|
 |
文本框内容的复制/粘贴/清空代码 |
|
2366 |
2007-06-06 |
FORM name=CodeTest
TEXTAREA name=WenBei rows=6 cols=50/TEXTAREABRBR
INPUT onclick="CodeTest.WenBei.select();document.execCommand('Copy');" type=button value=复制文本INPUT onclick="CodeTest.WenBei.focus();document.execCommand('Paste');" type=button value=粘贴文本INPUT onclick=".. |
|
 |
文本框字数输入限制 |
|
1748 |
2007-06-06 |
Script Language="JavaScript"!--maxLen=10;function checkMaxInput(form) {if (form.message.value.length maxLen)form.message.value = form.message.value.substring(0, maxLen);else form.remLen.value = maxLen - form.message.value.length;}//--/script
form name="myform" action="1.asp"
.. |
|
 |
虚拟抽奖程序 |
|
1893 |
2006-09-14 |
script language="JavaScript"function lotto(){if (!document.all!document.layers)returnfor (j=1; j 48; j++)//stop zero!?{var a=Math.round(Math.random()*j+1);var b=Math.round(Math.random()*j+1);var c=Math.round(Math.random()*j+1);var d=Math.round(Math.random()*j+1);var e=Math.roun.. |
|
|