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×Ö· ......
Ò³ÃæÌá½»Êý¾ÝÒ»°ãÓÐÁ½ÖÖ·½·¨£ºget,post¡£post¾ÍÊÇËùνµÄformÌá½»£¬Ê¹ÓÃÊÓͼ£»getÊÇͨ¹ýurlÌá½»¡£
Get·½·¨Ò»°ãÓúǫ́´úÂ루Èçasp,asp.net£©»ñµÃ²ÎÊý£¬´úÂëºÜ¼òµ¥£ºRequest.QueryString["id"];¼´¿É»ñÈ¡¡£
ÓÐЩʱºòÐèÒªÖ±½ÓÔÚǰ̨»ñÈ¡url²ÎÊý£¬ÒªÓõ½javascript£¬jsûÓÐÖ±½Ó»ñÈ¡url²ÎÊýµÄ·½·¨£¬ÄÇô£¬ÎÒÃÇÈçºÎͨ¹ýjs ......
String Trimming ×Ö·û´®ÐÞ¼ô
Removing leading and trailing whitespace from a string is a simple but common task. Although ECMAScript 5 adds a native string trim method (and you should therefore start to see this method in upcoming browsers), JavaScript has not historically in ......
µÚÁùÕ Responsive Interfaces ÏìÓ¦½Ó¿Ú
There's nothing more frustrating than clicking something on a web page and having nothing happen. This problem goes back to the origin of transactional web applications and resulted in the now-ubiquitous "please click only once" m ......
Summary ×ܽá
When web pages or applications begin to feel slow, analyzing assets as they come over the wire and profiling scripts while they are running allows you to focus your optimization efforts where they are needed most.
µ±ÍøÒ³»òÓ¦ÓóÌÐò±äÂýʱ£¬·ÖÎ ......