javascript ÅжÏÎļþÀàÐÍ
function checkfiletype()
{
var fileName = document.getElementById('<%=FilePath.ClientID%>').value;
if (Trim(fileName)=="")
{
alert("ÇëÑ¡ÔñÒªÉÏ´«µÄÎļþ£¡");
document.getElementById('<%=FilePath.ClientID%>').focus();
return false;
}
//ÉèÖÃÎļþÀàÐÍÊý×é
var extArray = new Array(".rar",".doc",".rtf",".xls");
//»ñÈ¡ÎļþÃû³Æ
while (fileName.indexOf("\\") != -1)
fileName = fileName.slice(fileName.indexOf("\\") + 1);
//»ñÈ¡ÎļþÀ©Õ¹Ãû
var ext = fileName.slice(fileName.indexOf(".")).toLowerCase();
//±éÀúÎļþÀàÐÍ
for (var i = 0; i < extArray.length; i++)
{
if (extArray[i] == ext)
{
return true;
}
}
alert("Ö»ÄÜÉÏ´«ÏÂÁÐÀàÐ͵ÄÎļþ: " + extArray.join(" "));
document.getElementById('<%=FilePath.ClientID%>').focus();
return false;
}
Ïà¹ØÎĵµ£º
label:statement
Àý£º
start:var iCount = 10;
±êÇ©¿ÉÒÔ±»ºóÀ´µÄbreakÓï¾ä»òcontinueÓï¾äÒýÓá£
Àý£º
var iNum=0;
outermost:
&n ......
deleteÖ»ÄÜɾ³ý¿ª·¢Õ߶¨ÒåµÄÊôÐÔ»ò·½·¨£¬ÔʼµÄECMAScript·½·¨²»ÄÜɾ³ý£¬ÒòΪ²»ÊÇ¿ª·¢Õ߶¨ÒåµÄ£¬±ÈÈ磺toString()¡£
var o = new Object;
o.name = "Nicholas";
delete o.name;
&n ......
ÎÒÃǶ¼ÖªµÀ£¬ajaxÄÜÌá¸ßÒ³ÃæÔØÈëµÄËٶȵÄÖ÷ÒªÔÒòÊÇͨ¹ýajax¼õÉÙÁËÖظ´Êý¾ÝµÄÔØÈ룬ÕæÕý×öµ½°´Ðè»ñÈ¡£¬¼ÈÈ»Èç´Ë£¬ÎÒÃÇÔÚдajax³ÌÐòµÄʱºò²»·ÁËÍ·ðË͵½Î÷£¬ÔÚ¿Í»§¶ËÔÙ×öÒ»´Î»º´æ,½øÒ»²½Ìá¸ßÊý¾ÝÔØÈëËٶȡ£ÄǾÍÊÇÔÚÔØÈëÊý¾ÝµÄͬʱ½«Êý¾Ý»º´æÔÚä¯ÀÀÆ÷ÄÚ´æÖУ¬Ò»µ©Êý¾Ý±»ÔØÈ룬ֻҪҳÃæδˢУ¬¸ÃÊý¾Ý¾ÍÓÀÔ¶µÄ»º´æÔÚÄÚ´æÖУ¬µ±Ó ......
½ñÌìÔÚ×öJAVASCRIPTµÄʱºò,·¢ÏÖÀÏÊdzöÏ֔δ½áÊøµÄ×Ö·û´®³£Á¿”.
×Ô¼ºÕÒÁËÏÂÓ¦¸ÃÊÇ´«²ÎÊýµÄʱºò,ÓÐÌØÊâ×Ö·ûÒýÆðµÄ.ÍøÉÏÒ²ÕÒÁËÏÂ,Ò²Óкöà³öÏÖÕâÖÖÇé¿ö.×öÏÂ×ܽá,ÒÔ·½±ãÒÔºó²éÔÄ.
1.JAVASCRIPTÒýÓÃʱ,ʹÓõÄ×Ö·ûÓïÑÔ²»Ò»ÖÂ.
±ÈÈç:<script type=”text/javascript” src=”xxx.js” char ......