Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javascript ¶¯Ì¬²åÈëÐÐ ±í¸ñ²Ù×÷

<script>  
    var i = 0;
    function insertTr(obj)  
    {  
        var tr1 =  tb.insertRow(obj.rowIndex+1);  
        var td1 =  tr1.insertCell();  
        td1.innerHTML = "newCell" + i; 
        i += 1;
     }  
  </script>  
   
  <table id=tb>  
  <tr onclick="insertTr(this)">  
  <td>2</td>  
  </tr>  
  <tr onclick="insertTr(this)">  
    <td>1</td>  
  </tr>  
  </table>  
±í¸ñ²Ù×÷Àà(Ìí¼Ó£¬É¾³ý£¬ÅÅÐò£¬ÉÏÒÆ£¬ÏÂÒÆ)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">*{font-size:14px}button{margin:3px}</style>
<script type="text/javascript">
var mytable=null,mytable2=null;
window.onload=function(){
mytable=new CTable("tbl",10);
mytable2=new CTable("tbl2",6);
}
Array.prototype.each=function(f){for(var i=0;i<this.length;i++) f(this[i],i,this)}
function $A(arrayLike){
for(var i=0,ret=[];i<arrayLike.length;i++) ret.push(arrayLike[i]);
return ret
}
Function.prototype.bind = function() {
  var __method = this, args = $A(arguments), object = args.shift();
  return function() {
    return __method.apply(object, args.concat($A(arguments)));
  }
}
function CTable(id,rows){
this.tbl=typeof(id)=="string"?document.getElementById(id):id; 
if (rows && /^\d+$/.test(rows)) this.addrows(rows)
}
CTable.prototype={
addrows:func


Ïà¹ØÎĵµ£º

JavaScript Cookie µÄÕýÈ·Ó÷¨

function getCookies(name)
{
var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
if(arr != null) return unescape(arr[2]); return '';
}
function setCookie(name, value, expires, path, domain, secure)
{
var liveDate = new Date();
expires = l ......

JavaScript»ñÈ¡µ±Ç°Îļþȫ·¾¶¡¢µ±Ç°Ä¿Â¼¡¢µ±Ç°ÎļþÃû

//»ñÈ¡µ±Ç°Îļþȫ·¾¶
<script language="javascript"> 
alert(window.location.href); 
alert(window.location); 
alert(location.href); 
alert(parent.location.href); 
alert(top.location.href); 
alert(document.location.href); 
alert(document.URL);
</scri ......

Javascript: setTimeout()ʹÓü° setInterval()ʹÓÃ

Evaluates an expression after a specified number of milliseconds has elapsed.
(ÔÚÖ¸¶¨Ê±¼ä¹ýºóÖ´ÐÐÖ¸¶¨µÄ±í´ïʽ)
Syntax:
iTimerID = window.setTimeout(vCode, iMilliSeconds [, sLanguage])
Parameters
vCode
Required. Variant that specifies the function pointer or string that indicates the code to be ......

javascriptÓÅ»¯·½·¨

ÐÞ¸ÄÑ­»·µÄÖ´Ðз½Ê½
for(var i=0;i<element.childNodes.length;i++){
Ö´ÐдúÂë
}
ÕâÖÖ·½Ê½Ã¿´ÎÑ­»·¶¼ÒªÈ¡element.childNodes.lengthµÄÖµ£¬Ó¦¸Ã¸ÄΪÈçϵÄ
var n£½element.childNodes.length
for(var i=0;i<n;i++){
Ö´ÐдúÂë
}
2£ºÐÞ¸Ädom²Ù×÷µÄ´ÎÊý
domÅúÁ¿²åÈëÒ»ÅúÀàËƵĽڵ㲻ÈçÏȹ¹ÔìÒ»¸ö¶ÔÏó£¬ ......

Java 6 ÖÐÒ²¿ÉÒÔÔËÐÐ javascript ච(ת)

¸ø Java SE ×¢Èë½Å±¾ÓïÑԵĻîÁ¦
Mustang µÄ½Å±¾ÓïÑÔÐÂÌØÐÔ

ÎĵµÑ¡Ïî

½«´ËÒ³×÷Ϊµç×ÓÓʼþ·¢ËÍ

½«´ËÒ³×÷Ϊµç×ÓÓʼþ·¢ËÍ



¼¶±ð£º Öм¶
Îâ 玥ò« (wuyuehao@cn.ibm.com), Èí¼þ¹¤³Ìʦ, IBM
2006 Äê 10 ÔÂ 30 ÈÕ
ÔÚ¼´½«·¢²¼µÄ Java SE6£¨Mustang£©ÖУ¬Ôö¼ÓÁ˶Խű¾ÓïÑÔµÄÖ§³Ö¡£Í¨¹ý¶Ô½Å± ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ