JavaScript¸ôÐбäÉ«
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>JavaScriptʵÏÖ¸ôÐбäÉ«µÄ±í¸ñ</title>
<style>
<!--
.datalist{
border:1px solid #007108; /* ±í¸ñ±ß¿ò */
font-family:Arial;
border-collapse:collapse; /* ±ß¿òÖصþ */
background-color:#d9ffdc; /* ±í¸ñ±³¾°É« */
font-size:14px;
}
.datalist th{
border:1px solid #007108; /* ÐÐÃû³Æ±ß¿ò */
background-color:#00a40c; /* ÐÐÃû³Æ±³¾°É« */
color:#FFFFFF; /* ÐÐÃû³ÆÑÕÉ« */
font-weight:bold;
padding-top:4px; padding-bottom:4px;
padding-left:12px; padding-right:12px;
text-align:center;
}
.datalist td{
border:1px solid #007108; /* µ¥Ôª¸ñ±ß¿ò */
text-align:left;
padding-top:4px; padding-bottom:4px;
padding-left:10px; padding-right:10px;
}
.datalist tr.altrow{
background-color:#a5e5aa; /* ¸ôÐбäÉ« */
}
-->
</style>
<script language="javascript">
window.onload = function(){
var oTable = document.getElementById("oTable");
for(var i=0;i<oTable.rows.length;i++){
if(i%2==0) //żÊýÐÐʱ
oTable.rows[i].className = "altrow";
}
}
</script>
</head>
<body>
<table class="datalist" summary="list" id="oTable">
<tr>
<th scope="col">Name</th>
<th scope="col">Class</th>
</tr>
<tr>
<td>slepox</td>
<td>W19</td>
</tr>
<tr>
<td>smartlau</td>
<td>W19</td>
</tr>
<tr>
<td>shenhuanyan</td>
<td>W25</td>
</tr>
</tabl
Ïà¹ØÎĵµ£º
½ñÌìAJAX±ØÐëÓÃJS£¬×öÇ°¶Ë±ØÐëÓÃJS£¬ÓÉÓڿγ̽ô£¬Ö»°²ÅÅÁËÒ»Ììʱ¼ä£¬Ö»½²ÁËDom¡£ DOM ¿ÉÔÚJ2SEAPIËÑDocument£¬±ã¿ÉÒԲ鿴·½·¨ DOMÊ÷:½Úµã£¨node£©µÄ²ã´Î¡£ ½Úµã·ÖΪÈýÖÖÀàÐÍ£º ½Úµã£¨node£©£ºÀ´Ô´ÓÚÍøÂçÀíÂÛ£¬´ú±íÍøÂçÖеÄÒ»¸öÁ¬½Óµã¡£ÍøÂçÊÇÓɽڵ㹹³ÉµÄ¼¯ºÏ 1.½Úµã·ÖΪÈýÖÖÀàÐÍ£º
element node attribute node ......
Ò»¡¢ÐÂÔöÒ»¸öoption
var sel=document.getElementById("selectµÄid");
var op=document.createElement("option");
op.value=Öµ;
op.text=ÏÔʾÎı¾;
sel.add(op);
¶þ¡¢É¾³ýÒ»¸öoption
var sel=document.getElementById("typelist");
if(sel.selectedIndex==-1)
alert("ÇëÑ¡ ......
<asp:TextBox ID="TextBox1" runat="server" onkeydown="return NotAllowSpace(this);"/></asp:TextBox>
<mce:script type="text/javascript" language="javascript"><!--
function NotAllowSpace(e)
{
var keyVal =(window.event) ? event.keyCode : e.keyCode; ......
תÔØ:JavaScript»ñÈ¡Ò³Ãæ¿í¶È¸ß¶È´óÈ«
µØÖ·:http://www.cnblogs.com/wcg249165510/archive/2009/02/20/1394749.html
ÍøÒ³¿É¼ûÇøÓò¿í£ºdocument.body.clientWidth
ÍøÒ³¿É¼ûÇøÓò¸ß£ºdocument.body.clientHeight
ÍøÒ³¿É¼ûÇøÓò¿í£ºdocument.body.offsetWidth(°üÀ¨±ßÏߵĿí)
ÍøÒ³¿É¼ûÇøÓò¸ß£ºdocument.body.offsetHeight(° ......