JavaScript±à³Ì±Ê¼Ç
ÐÂÖÐ……
1¡¢Êý¾ÝÀàÐÍÑéÖ¤ÎÊÌâ
Asp.NetËäÈ»ÓÐÑéÖ¤¿Ø¼þ£¬µ«ÊÇÓÐЩ¸´ÔÓµÄÑéÖ¤»¹Êǵô«µ½·þÎñÆ÷ÉϽøÐУ¬ÓÃjsËٶȺÍÐÔÄܶ¼±È½ÏºÃ
<script>
//¼ì²éÊÇ·ñΪÈÎÒâÊý£¨ÊµÊý£©
function isNumeric(strNumber) {
var newPar=/^(-|\+)?\d+(\.\d+)?$/
alert(newPar.test(strNumber)); }
//¼ì²éÊÇ·ñΪÕýÊý
function isUnsignedNumeric(strNumber) {
var newPar=/^\d+(\.\d+)?$/
alert(newPar.test(strNumber)); }
//¼ì²éÊÇ·ñΪÕûÊý
function isInteger(strInteger) {
var newPar=/^(-|\+)?\d+$/
alert(newPar.test(strInteger)); }
//¼ì²éÊÇ·ñΪÕýÕûÊý
function isUnsignedInteger(strInteger) {
var newPar=/^\d+$/
alert(newPar.test(strInteger)); }
</script>
2¡¢asp.netÖÐÓÃalert£¨£©ÊµÏÖ»»ÐÐÎÊÌâ
asp.netÖÐÓÃresponse.Write("<script>alert('Ìáʾ£º\n²Ù×÷³ö´í£¡');</script>");ÎÞ·¨Ö´ÐС£
½«×Ö·û´®Ð´³É
say="Ìáʾ£º\\n²Ù×÷³ö´í£¡"
say=@"Ìáʾ£º\n²Ù×÷³ö´í£¡"
3¡¢jsʵÏÖË¢ÐÂÑéÖ¤Âë
µ¥»÷ͼƬˢУº
<img id="CheckImg" src="CreatImage.aspx" onclick="this.src='CreatImage.aspx?temp='+Math.random()"/>
µ¥»÷“Ë¢ÐÂÑéÖ¤Âë”°´Å¥Ë¢ÐÂ
function imagechick()
{
form1.CheckImg.src="CreatImage.aspx?temp="+Math.random();
return false;//²»ÉÏ´«µ½·þÎñÆ÷
}
ÆäÖÐCreatImage.aspxΪ²úÉúÑéÖ¤ÂëͼƬµÄÒ³Ã棬ԴÂë¼û£ºC#²úÉúͼÐÎÑéÖ¤Âë
4¡¢jsÖÐʹÓÃÕýÔò±í´ïʽµÄ·½·¨
¸ñʽÊÇ£º/ÕýÔò±í´ïʽ/
±ØÐëÓÃÁ½¸öб¸Ü°ÑÕýÔò±í´ïʽÀ¨ÆðÀ´¡£
Èç·Ç·¨×Ö·û¼ì²âÕýÔò±í´ïʽΪ£º^(?:[\u4e00-\u9fa5]*\w*\s*)+$
ʹÓõĴúÂëΪ£º
var newPar=/^(?:[\u4e00-\u9fa5]*\w*\s*)+$/;
if(newPar.test("1234&1238*_~"))
{
&
Ïà¹ØÎĵµ£º
±¾ÎÄÖ÷ÒªÊdzöÓÚÓÐÅóÓÑʹÓÃÎÒÔÀ´Ð´µÄautocompleteµÄJS¿Ø¼þ¡£µ±Êý¾ÝÁ¿´óµÄʱºò£¬»á³öÏÖЧÂʼ«ÆäÂýµÄÇé¿ö£¬ÎÒÔÚÕâ¶Îʱ¼ä×ö³öµÄһЩ²âÊÔÒ²¼°Ò»Ð©¾Ñ飬Óë´ó¼Ò·ÖÏí£¬Èç¹ûÓдíµÄµØ·½£¬»¹ÇëÖ¸³ö¡£
¾¹ý²âÊÔ£¬ÎÒÃǻᷢÏÖÈçϵÄÇé¿ö»òÕß˵µÄ½áÂÛ£¬Èç¹ûÄúµÄ²âÊÔ½á¹ûÓëÎҵIJ»·û£¬Çë˵Ã÷ÔÒò£¬ÒÔ±ãÏ໥ѧϰ¡£
1£©µ±Ò»¸ö½Ï´óµÄHTML×Ö· ......
µÚËÄÕ Algorithms and Flow Control Ëã·¨ºÍÁ÷³Ì¿ØÖÆ
The overall structure of your code is one of the main determinants as to how fast it will execute. Having a very small amount of code doesn't necessarily mean that it will run quickly, and having a large amount of code ......
Conditionals Ìõ¼þ±í´ïʽ
Similar in nature to loops, conditionals determine how execution flows through JavaScript. The traditional argument of whether to use if-else statements or a switch statement applies to JavaScript just as it does to other languages. Since different b ......
Splitting Up Tasks ·Ö½âÈÎÎñ
What we typically think of as one task can often be broken down into a series of subtasks. If a single function is taking too long to execute, check to see whether it can be broken down into a series of smaller functions that complete in smaller ......
JavaScript Minification JavaScript½ô´Õ
JavaScript minification is the process by which a JavaScript file is stripped of everything that does not contribute to its execution. This includes comments and unnecessary whitespace. The process typically reduces the file size by ha ......