JavaScript³£ÓôúÂë
1:js ×Ö·û´®³¤¶ÈÏÞÖÆ¡¢ÅжÏ×Ö·û³¤¶È¡¢jsÏÞÖÆÊäÈë¡¢ÏÞÖƲ»ÄÜÊäÈë¡¢textarea ³¤¶ÈÏÞÖÆ
2.:jsÅжϺº×Ö¡¢ÅжÏÊÇ·ñºº×Ö ¡¢Ö»ÄÜÊäÈ뺺×Ö
3:jsÅжÏÊÇ·ñÊäÈëÓ¢ÎÄ¡¢Ö»ÄÜÊäÈëÓ¢ÎÄ
4:jsÖ»ÄÜÊäÈëÊý×Ö,ÅжÏÊý×Ö¡¢ÑéÖ¤Êý×Ö¡¢¼ì²âÊý×Ö¡¢ÅжÏÊÇ·ñΪÊý×Ö¡¢Ö»ÄÜÊäÈëÊý×Ö
5:Ö»ÄÜÊäÈëÓ¢ÎÄ×Ö·ûºÍÊý×Ö
6: js emailÑéÖ¤ ¡¢js ÅжÏemail ¡¢ÐÅÏä/ÓÊÏä¸ñʽÑéÖ¤
7:js×Ö·û¹ýÂË,ÆÁ±Î¹Ø¼ü×Ö
8:jsÃÜÂëÑéÖ¤¡¢ÅжÏÃÜÂë
2.1: js ²»Îª¿Õ¡¢Îª¿Õ»ò²»ÊǶÔÏó ¡¢ÅжÏΪ¿Õ¡¢Åжϲ»Îª¿Õ
2.2:±È½ÏÁ½¸ö±íµ¥ÏîµÄÖµÊÇ·ñÏàͬ
2.3:±íµ¥Ö»ÄÜΪÊý×ÖºÍ"_",
2.4:±íµ¥ÏîÊäÈëÊýÖµ/³¤¶ÈÏÞ¶¨
2.5:ÖÐÎÄ/Ó¢ÎÄ/Êý×Ö/ÓʼþµØÖ·ºÏ·¨ÐÔÅжÏ
2.6:ÏÞ¶¨±íµ¥Ïî²»ÄÜÊäÈëµÄ×Ö·û
2.7±íµ¥µÄ×Ô·û¿ØÖÆ
2.8:formÎı¾ÓòµÄͨÓÃУÑ麯Êý
1. ³¤¶ÈÏÞÖÆ
<script>
function test()
{
if(document.a.b.value.length>50)
{
alert("²»Äܳ¬¹ý50¸ö×Ö·û£¡");
document.a.b.focus();
return false;
}
}
</script>
<form >
<textarea cols="40" wrap="VIRTUAL" rows="6"></textarea>
<input type="submit" value="check">
</form>
2. Ö»ÄÜÊǺº×Ö
<input /oblog/value.replace(/[^\u4E00-\u9FA5]/g,'')">
3." Ö»ÄÜÊÇÓ¢ÎÄ
<script language=javascript>
function onlyEng()
{
if(!(event.keyCode>=65&&event.keyCode<=90))
event.returnvalue=false;
}
</script>
<input >
4. Ö»ÄÜÊÇÊý×Ö
<script language=javascript>
function onlyNum()
{
if(!((event.keyCode>=48&&event.keyCode<=57)||(event.keyCode>=96&&event.keyCode<=105)))
//¿¼ÂÇС¼üÅÌÉϵÄÊý×Ö¼ü
event.returnvalue=false;
}
</script>
<input >
5. Ö»ÄÜÊÇÓ¢ÎÄ×Ö·ûºÍÊý×Ö
<input /oblog/value.replace(/[\W]/g,"'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">
6. ÑéÖ¤ÓÍÏä¸ñʽ
<SCRIPT LANGUAGE=javascript RUNAT=Server>
function isEmail(strEmail) {
if (strEmail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
return true;
else
alert("oh");
}
</SCRIPT>
<input type=text
7. ÆÁ±Î¹Ø¼ü×Ö(ÕâÀïÆÁ±Î***ºÍ****)
<script language="javas
Ïà¹ØÎĵµ£º
"^\d+$"¡¡¡¡//·Ç¸ºÕûÊý£¨ÕýÕûÊý + 0£©
"^[0-9]*[1-9][0-9]*$"¡¡¡¡//ÕýÕûÊý
"^((-\d+)|(0+))$"¡¡¡¡//·ÇÕýÕûÊý£¨¸ºÕûÊý + 0£©
"^-[0-9]*[1-9][0-9]*$"¡¡¡¡//¸ºÕûÊý
"^-?\d+$"¡¡¡¡¡¡¡¡//ÕûÊý
"^\d+(\.\d+)?$"¡¡¡¡//·Ç¸º¸¡µãÊý£¨Õý¸¡µãÊý + 0£©
"^(([0 ......
Js´úÂë
<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="wmp" >
<param name="URL" value="" /> ......
°æ±¾£ºDHTML Object Model¡¡·µ»ØÖµ£ºÓÐ
Óï·¨£º
oTextRange = object . createTextRange ()
²ÎÊý£º
ÎÞ
·µ»ØÖµ£º
oTextRange : ¶ÔÏó(Element)¡£Èç¹û³É¹¦µÄ»°·µ»Ø±»½¨Á¢µÄ TextRange ¶ÔÏó¡£
˵Ã÷£º
Ϊ object ½¨Á¢ TextRange ¶ÔÏó¡£
ʹÓÃ´Ë TextRange ¶ÔÏó¿ÉÒÔ¼ìË÷ºÍÐÞ¸Ä object ÄÚµÄÎı¾¡£ TextRange ¶ÔÏ ......
Õâ¶Îʱ¼äÔÚÓÃdisplayTag, ËüÓкܶàºÃÓõŦÄÜ,°³Ò²²»¾ÍÔÚÕâ׸Êö,µ±È»Ò²Óм¸¸ö²»·½±ãµÄµØ·½. ±ÈÈçÇóºÍºó"%"µÄÏÔʾµÈÓëÇóºÍÏà¹ØµÄȱµã, ÕâÀïÏȽéÉÜÒ»¸öȱµã²¢°ÑÎÒ´ÓÍøÉÏÕûÀí³öÀ´µÄ½â¾ö·½°¸Ò²Ò»²¢Ìû³ö. ÎÊÌâÊÇÕâÑùµÄ: ÓÉÓÚÒµÎñÒªÇó, µ±Óû§Êó±êλÓÚ±íÖÐijһÁеıêͷʱ, ÔÚÕâ¸ö±íÍ·"¶¯»"µØÏÔʾÕâÁеļò½é. ÏÈ¿´ÏÂ×ö³öÀ´µÄЧ¹û: ......
ÓÃJavascript¿ÉÒÔʵÏÖ¶ÔGridViewÖÐijһÐÐÑ¡Ôñ£¬¶øÎÞÐè½øÐÐÒ³ÃæµÄˢС£
Ê×ÏÈÒªÔÚGridViewµÄonrowdataboundµÄevent handlerÖÐΪGridViewÖеÄÿһÐÐonclick°ó¶¨event handler (Javascript)¡£¼ÙÈçGridView´úÂëÈçÏ£º
<asp:GridView runat="server" id="GridViewCategory" Aut ......