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

JavaScript_»ñÈ¡Îļþ´óС

ºÜ¶àÇé¿öÏ£¬ÎÒÃÇÒªÔÚ·¢Ë͵½ºǫ́´¦ÀíÇ°£¬ÅжÏÒ»ÏÂËùÉÏ´«µÄÎļþÊDz»ÊÇ·ûºÏ´óСҪÇó£¬Æäʵ½Å±¾¿ÉÒԺܷ½±ãµÄ°ïÖúÎÒÃÇʵÏÖ£¬´úÂëÈçÏÂ
<html>
<head>
<title>JavaScript_»ñÈ¡Îļþ´óС_°¢·½Ë÷</title>
</head>
<body>
<input type="file" name="file1" id="file1" size="40" onchange="changeSrc(this)"/>
<img src="about:blank" mce_src="about:blank" id="fileChecker" alt="test" width="100" style="display:none" mce_style="display:none"
/>
<span id="showSize"></span>
</body>
</html>
<!--////ÒÔÏ´úÂë·Åµ½Ò³Ãæ×îºóÃæ-->
<mce:script type="text/javascript"><!--

var oFileChecker = document.getElementById("fileChecker");
function changeSrc(filePicker)
{
oFileChecker.src = filePicker.value;//¶ÁͼƬ
}
//ÅжÏÊÇ·ñÍêÈ«¶ÁÍê
oFileChecker.onreadystatechange = function ()
{
if (oFileChecker.readyState == "complete")
{
checkSize();
}
}
function checkSize()
{
var limit = 2 * 1024 * 1024;
var show = document.getElementById("showSize");
if (oFileChecker.fileSize > limit)
{
oFileChecker.style.display = 'none';
show.innerHTML = parseInt(oFileChecker.fileSize/1024) + "KB[" +
oFileChecker.fileSize + "×Ö½Ú]&nbsp;&nbsp;<font color='red'>* ¸½¼þ²»ÄÜ´óС²»Äܳ¬¹ý
&nbsp;<b>" + limit/1024 + "</b>&nbsp;KB</font>";
}
else
{
oFileChecker.style.display = '';
show.innerHTML = parseInt(oFileChecker.fileSize/1024) + "KB[" +
oFileChecker.fileSize + "×Ö½Ú]&nbsp;&nbsp;<font color='green'>´óСÕý³£</font>";
}
}
// --></mce:script>


Ïà¹ØÎĵµ£º

ÓÐ¹Ø JavaScript µÄ 10 ¼þÈÃÈ˷ѽâµÄÊÂÇé

JavaScript ¿ÉËãÊÇÊÀ½çÉÏ×îÁ÷Ðеıà³ÌÓïÑÔ£¬ËüÔø±» Web ¿ª·¢Éè¼ÆʦÌùÉÏجÃεıêÇ©£¬ËäÈ»ÕæÕýµÄجÃÎÆäʵÊÇ DOM
API£¬Õâ¸ö±»´óÁ¿µÄ¿ª·¢ÓëÉè¼ÆʦËæÊÖÄéÀ´ÔöÇ¿ËûÃÇµÄ Web Ç°¶ËµÄ½Å±¾ÓïÑÔ£¬Èç½ñÔ½À´Ô½±»ÖØÊÓ£¬ËäÔòÈç´Ë£¬JavaScript
ÈÔȻӵÓкܶàÈÃÈ˷ѽâµÄ¶«Î÷¡£
1. ËüÒÔ Java ÃüÃû£¬µ«²¢²»ÊÇ Java
Ëü×î³õ½Ð Mocha£¬ ½ÓןÄà ......

ÓÐ¹Ø JavaScript µÄ 10 ¼þÈÃÈ˷ѽâµÄÊÂÇé

JavaScript ¿ÉËãÊÇÊÀ½çÉÏ×îÁ÷Ðеıà³ÌÓïÑÔ£¬ËüÔø±» Web ¿ª·¢Éè¼ÆʦÌùÉÏجÃεıêÇ©£¬ËäÈ»ÕæÕýµÄجÃÎÆäʵÊÇ DOM
API£¬Õâ¸ö±»´óÁ¿µÄ¿ª·¢ÓëÉè¼ÆʦËæÊÖÄéÀ´ÔöÇ¿ËûÃÇµÄ Web Ç°¶ËµÄ½Å±¾ÓïÑÔ£¬Èç½ñÔ½À´Ô½±»ÖØÊÓ£¬ËäÔòÈç´Ë£¬JavaScript
ÈÔȻӵÓкܶàÈÃÈ˷ѽâµÄ¶«Î÷¡£
1. ËüÒÔ Java ÃüÃû£¬µ«²¢²»ÊÇ Java
Ëü×î³õ½Ð Mocha£¬ ½ÓןÄà ......

javascript²¶»ñ´°¿Ú¹Ø±Õʼþ


javascript²¶»ñ´°¿Ú¹Ø±ÕʼþÓÐÁ½ÖÖ·½·¨
1.ÓÃjavascriptÖØж¨Òå window.onbeforeunload()  ʼþ
ÔÚjavascriptÀﶨÒåÒ»¸öº¯Êý¼´¿É
function  window.onbeforeunload()  {  alert("¹Ø±Õ´°¿Ú")}
alert()ʼþ½«»áÔڹرմ°¿ÚÇ°Ö´ÐУ¬ÄãÒ²¿ÉÒÔÓû§¾ö¶¨ÊÇ·ñ¹Ø±Õ´°¿Ú
function  window.o ......

Ò»¾ä»°Àí½âjavascript prototypeÊôÐÔ

Õâ¾ä»°ÊÇ£ºprototypeÖж¨ÒåµÄÊǶÔÏóʵÀýÒª·ÃÎʵÄÊôÐÔ»ò·½·¨µÄÒ»¸öÌæ²¹¡£
¾ÙÀý˵Ã÷һϣº
//1£©¶¨ÒåÁËÒ»¸ö¶ÔÏó£º
function A()
{
//¸ø¶ÔÏó¶¨ÒåÒ»¸öÊôÐÔ
this.f1="this is f1";
}
//2£©ÎÒÃÇ¿ÉÒÔÕâÑùʹÓöÔÏó£º
var a = new A();
alert(a.f1)//µ¯³öÏûÏ¢£ºthis is f1
//3£©ÎÒÃÇ¿ÉÒÔÀ©Õ¹¶ÔÏó£º
A.prot ......

Javascript ÄäÃûº¯Êý¼°Æä´úÂëģʽԭÀí

֮ǰ¿´ÁËÓйØÄäÃûº¯ÊýµÄµ÷Ó㬸оõÓбØÒªºÍ´ó¼Ò·ÖÏíһϡ£
¹ØÓÚʲôÊÇÄäÃûº¯Êý£¬¼°Ëü´øÀ´µÄÓÅÊÆÔÚ±¾ÎľͲ»ÉÁË£¬ÏÈÅ׳öÒ»¸ö³£ÓõÄÄäÃûº¯Êý£º
(function(){alert('yo')})()
ºÜ¶àͬѧ֪µÀÔõôÓÃÕâÖÖÄäÃûº¯Êý£¬È´»òÐí²¢²»Ã÷°×ΪʲôÕâÑùд¾ÍÄܹ»µ÷ÓÃÄäÃûº¯Êý¡£Ò²ÐíÖªµÀºóÃæµÄÔ²À¨ºÅÊÇÖ´ÐÐÇ°ÃæµÄº¯Êý£¬¶ø²¢²»Çå³þÇ°ÃæµÄÔ² ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ