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

javascriptʵÏÖ×Ô¶¯ÇóºÍ

function total(){
var i=0;
for(j=1;j<=20;j++)
{
var step="step"+j;
if(document.getElementById(step)){
if(document.getElementById(step).checked==true)
{
i=i+parseInt(document.getElementById(step).value);
}
}
}
document.getElementById("total").innerHTML = i;
}
function Resetvalue(){
for(j=1;j<=20;j++)
{
if(document.getElementById("step"+j)!=null){
   document.getElementById("step"+j)&0;}
document.getElementById("total").innerHTML = "0";}
}
function allselect()
{
for(j=1;j<=20;j++)
{
if(document.getElementById("step"+j)!=null){
   document.getElementById("step"+j).checked=true;}
 
}
var ischecked=0;
var obj=document.getElementById("thisform");
for(k=0;k<obj.vom.length;k++)
{
if(obj.vom[k].checked)
ischecked=1;
}
if(ischecked==0)
{
   obj.vom[1].checked=true;
}
total();
}
html²¿·Ö
<form name="thisform">
<input name="step1" type="checkbox" value="1" onClick="total()"/>1<br/>
<input name="step2" type="checkbox" value="2" onClick="total()"/>2<br/>
<input name="step3" type="checkbox" value="3" onClick="total()"/>3<br/>
<input name="step4" type="checkbox" value="4" onClick="total()"/>4<br/>
<input name="step5" type="checkbox" value="5" onClick="total()"/>5<br/>
<input name="step6" type="checkbox" value="6" onClick="total()"/>6<br/>
<div id="total" >0</div>
<input type="button" name="Submit2" value="ȫѡ" onclick="allselect()" >
      <input type="reset" name="Submit2" value="ÖØÖÃ" onclick="Resetvalue()" >
</form>
---------------------------------HTML²¿·Ö2£¬ÕâÊÇÎÒ¼ÓÉÏÈ¥µÄ£¬Ö»×ö²Î¿¼¡£
<SCRIPTLANGUAGE=javascript> function sumNum() {var number1= isNaN(parseInt(num1.value,10))?0:parseInt(num1.value,10);var number2= isNaN(parseInt(num2.value,10))?0:parseInt(num2.value,10);var number3= isNaN(pars


Ïà¹ØÎĵµ£º

[·­Òë]High Performance JavaScript(010)

Cloning Nodes  ½Úµã¿Ë¡
    Another way of updating page contents using DOM methods is to clone existing DOM elements instead of creating new ones—in other words, using element.cloneNode() (where element is an existing node) instead of document.createElement().
 &nbs ......

ʹÓÃJavaScriptÁ¬½ÓSqlServerÊý¾Ý¿â¡£Ö´ÐÐCRUD²Ù×÷¡£

function db()
{
//»î¶¯±àºÅ
var activeid = Request.Form("activeid");
//Óû§Ãû
var username = Request.Form("username");
//ÊÖ»úºÅÂë
var mobile = Request.Form("mobile");
var conn= Server.CreateObject("ADODB.connection");
var rs= Serve ......

javascript¼Ì³Ð·½Ê½Ö®Èý

3¡¢×éºÏ¹¹Ô캯Êý/Ô­ÐÍ·½Ê½Ð´À࣬²ÉÓÃÇ°ÃæÖÖ·½Ê½¼Ì³Ð
ÕâÖÖ·½Ê½¸¸À࣬×ÓÀàµÄÊôÐÔ¶¼¹ÒÔÚ¹¹Ô캯ÊýÀ·½·¨¶¼¹ÒÔÚÔ­ÐÍÉÏ¡£
/**
* ¸¸ÀàPolygon:¶à±ßÐÎ
*/
function Polygon(sides) {
this.sides = sides;
}
Polygon.prototype.setSides = function(s) {this.sides=s;}
/**
* Triangle Èý½ÇÐÎ
* @param {Object} b ......

javascript typeofÓ¦ÓÃ

typeof ÊÇJavaScriptµÄÔËËã·û
    ——·µ»ØÒ»¸öÓÃÀ´±íʾ±í´ïʽµÄÊý¾ÝÀàÐ͵Ä×Ö·û´®
   typeof[(] expression [)]  //typeofÓï·¨ÖеÄÔ²À¨ºÅÊÇ¿ÉÑ¡Ïî
  typeof ÔËËã·û@import url(../html-vss/msdnie4a.css);
typeof
ÔËËã·û°ÑÀàÐÍÐÅÏ¢µ±×÷×Ö·û´®·µ»Ø¡£typeof
·µ»ØÖµÓÐÁ ......

JavaScript»ù´¡ÖªÊ¶3

Òþ²Ø³ÉÔ±±äÁ¿
ÔÚº¯ÊýÌåÄÚ¶¨ÒåµÄ±äÁ¿Îª¾Ö²¿±äÁ¿£¬À뿪º¯Êý¾Í¹ÒµôÁË
ÔÚº¯ÊýÌåÄÚʹÓÃthis.³ÉÔ±±äÁ¿Ãû£¬ÔòΪwindow¶ÔÏó¼¶±äÁ¿£¬¼´È«¾Ö±äÁ¿
¹ÊÐèÒªÕâÑùÒþ²Ø³ÉÔ±±äÁ¿£¬ÏòÍâÖ»±©Â¶get¡¢setº¯Êý
function testClass(name){
var _firstname=name;
return {
getname : function() {
return _fir ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ