JavaScript counter
µ±Ò³Ãæ¼ÓÔØÒÔºó£¬Ö´ÐÐJavaScript£¬°´Ã뿪ʼ¼ÆÊý£º
JavaScript function£º
<SCRIPT language="JavaScript">
<!--Timer in JavaScript
var timerform
speed=1000
function dotimer()
{
today=new Date()
slutsec=today.getSeconds()
slutmin=today.getMinutes()
sluttim=today.getHours()
sluta=(slutsec) + 60 * (slutmin) + 3600 * (sluttim)
diff=sluta - starta
tim=Math.floor(diff / 3600)
min=Math.floor((diff / 3600 - tim) * 60)
sek=Math.round((((diff / 3600 - tim) * 60) - min) * 60)
document.timerform.timer.value=tim + ':'
if(min<10)document.timerform.timer.value+='0'
document.timerform.timer.value+=min + ':'
if(sek<10)document.timerform.timer.value+='0'
document.timerform.timer.value+=sek
window.setTimeout("dotimer()",speed)
}
function Timer()
{
today=new Date()
startsek=today.getSeconds()
startmin=today.getMinutes()
starttim=today.getHours()
starta=(startsek) + 60 * (startmin) + 3600 * (starttim)
document.write('<form name=timerform><input name=timer size=7')
document.write('></form>')
dotimer()
}
// end-->
</SCRIPT>
HTML£º
<table width=420>
<tr>
<td align=center>
TIMER:
<SCRIPT language="JavaScript">
Timer()
</SCRIPT>
</td>
</tr>
</table>
ʵÏÖЧ¹û£º http://www.javascriptsearch.com/scripts/Counters/simple_counter.html
Ïà¹ØÎĵµ£º
ÀûÓÃjsÀ´¶¯Ì¬´´½¨±í¸ñÓÐÁ½ÖÖ¸ñʽ£¬appendChild()ºÍinsertRow¡¢insertCell()¡£Á½ÖÖ·½Ê½Æäʵ²î²»¶à£¬µ«µÚÒ»ÖÖÓпÉÄÜÔÚIEÉÏÓÐÎÊÌ⣬ËùÒÔÍƼö´ó¼ÒʹÓõڶþÖÖÁË£¬Ö±½Ó˵°É¡£
1¡¢inserRow()ºÍinsertCell()º¯Êý
insertRow()º¯Êý¿ÉÒÔ´ø²ÎÊý£¬ÐÎʽÈçÏ£º
insertRow(index)£ºindex´Ó0¿ªÊ¼
¡¡¡¡Õâ¸öº¯Êý½«ÐÂÐÐÌí¼Óµ½indexµÄÄÇÒ»ÐÐÇ ......
$wnd and $doc Calling native JavaScript with JSNI
$wnd ÊÇʲô£¿
GWT provides the $wnd and $doc variables to refer to the window and document objects
GWTʹÓÃͨ¹ýJava Native methodʹÓÃËü£¬ÉùÃ÷Ò»¸önative·½·¨£¬½«º¬ÓÐJavaScriptµÄ·½·¨Ìå×¢ÊÍ¡£±àÒëÆ÷½«×¢ÊÍ¿éÄÚµÄÄÚÈÝÖð×ÖÊä³ö£¬Ê¹Ö®Óë±àÒë²úÉúµÄJavaScriptÕûº ......
Although the days of long and tedious code branches to target specific browsers in JavaScript are over, once in a while it's still necessary to do some simple code branching and object detection to ensure that a certain piece of code is working properly on a user's machine.
In this article, I ......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>select-option onclick </title>
<script type="text/javascript" >
function simOptionClick4IE(){  ......
1.javascript¤ÇURL¤Î"?"ÒÔ½µ¤Î¥Ñ¥é¥áー¥¿¤òÈ¡µÃ£º
var query = window.location.search.substring(1);
var pairs = query.split("&");
2.IEä¯ÀÀÆ÷ĬÈϵŦÄÜÍ£Ö¹
£¨Tab¼üÔÚµØÖ·À¸µÈÖеÄÒƶ¯Í£Ö¹£©
function stopDefaultKey(){
window.e ......