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

JavaScriptʹÓü¼Çɾ«ÝÍ

(Ò»).È·ÈÏɾ³ýÓ÷¨:
  1. BtnDel.Attributes.Add("onclick","return confirm('"+"È·ÈÏɾ³ý?"+"')");
  2. linktempDelete.Attributes["onclick"]="javascript:return  confirm('"+"È·ÈÏɾ³ý?"+"');";
  3. private void grdProject_ItemDataBound(object sender, DataGridItemEventArgs e)
  4.
  {
 if ((e.Item.ItemType == ListItemType.Item) | (e.Item.ItemType == ListItemType.AlternatingItem))
 {
  // 刪³ý°´鈕ÉϵÄÌáʾ²¿·Ö
  e.Item.Cells[10].Attributes.Add("onclick", "return confirm('È·¶¨É¾³ýÂð£¿');");
 } 
  }
  5.
    <script language="JavaScript" type="text/JavaScript">
 function delete_y(e)
        {
    if(event.srcElement.outerText == "ɾ³ý")
        event.returnValue=confirm("È·¶¨É¾³ý?");
 }
 document.onclick=delete_y;
    </script>
(¶þ).¿çÓïÑÔ×Ö·û´®Ìæ»»
    System.Text.RegularExpressions.Regex.Replace(str1,@"<{1}[^<>]*>{1}","").Replace("&nbsp;","").Replace("&#092;","\\").Replace("&#045;","-").Replace("&amp;","&").Replace("&lt;","<").Replace("&gt;",">").Replace("br","\n");
(Èý).¹Ø±Õ´°Ìå
   1.
      this.btnClose.Attributes.Add("onclick",  "window.close();return false;");
   2.¹Ø±Õ±¾´°Ìå¼äÌø×ªµ½ÁíÒ»¸öÒ³Ãæ
      this.HyperLink1.NavigateUrl = "javascript:onclick=window.opener.location.assign
         ('" + "index.aspx"+ "?&am


Ïà¹ØÎĵµ£º

ASP.NETºǫ́´úÂëµ÷ÓÃǰ̨javascript½Å±¾µÄ·½·¨

ºÜ¶àÈ˶¼ÏòÔÚ·þÎñÆ÷¶Ëµ÷Óÿͻ§¶ËµÄº¯ÊýÀ´²Ù×÷£¬Ò²¾ÍÊÇÔÚaspÖе÷ÓÃjavascript½Å±¾ÖÐÒѾ­¶¨ÒåºÃµÄ½Å±¾º¯Êý¡£¾­¹ýÑо¿£¬·¢ÏÖÁËһЩÃãÇ¿µÄ·½·¨¡£
1. ÓÃResponse.Write·½·¨Ð´Èë½Å±¾
±ÈÈçÔÚÄãµ¥»÷°´Å¥ºó£¬ÏȲÙ×÷Êý¾Ý¿â£¬ÍêÁ˺óÏÔʾÒѾ­Íê³É£¬¿ÉÒÔÔÚ×îºóÏëµ÷Óõĵط½Ð´ÉÏ
Response.Write("<script type='text/javascrip ......

JavaScript»ù´¡Ó¦ÓÃ

JavaScript¾ÍÕâô»ØÊÂ1£º»ù´¡ÖªÊ¶
1 ´´½¨½Å±¾¿é
1: <script language=”JavaScript”>
2: JavaScript code goes here
3: </script>
2 Òþ²Ø½Å±¾´úÂë
1: <script language=”JavaScript”>
2: <!--
3: document.write(“Hello”);
4: // -->
5: </script ......

a±êÇ©ÖеÄhref,onclick,#,javascript:void¼òÒª·ÖÎö

<script type="text/javascript">
window.onbeforeunload=function()
{
alert("onbeforeunload event...");
//return false;
}
</script>
<a href="#" onclick="return true;">²âÊÔ1</a><br/>
<a href="javascript:void(0)" onclick="return true;">²âÊÔ2</a><br/& ......

JavaScriptÀï×Ö·û´®ÀàÐÍת»»³ÉÈÕÆÚÀàÐÍ


JavaScriptÀï×Ö·û´®ÀàÐÍת»»³ÉÈÕÆÚÀàÐÍ£º
Èç¹û×Ö·û´®ÖÐÓпոñ»òÊÇÆäËû·Ö¸î·û·Ö¸î£¬¿ÉÒÔÓÃsplit·½·¨ÏȲð·Ö£¬·µ»ØÒ»¸öÊý×飬ÔÙ°ÑÕâ¸öÊý×éÀïµÄÄêÔÂÈÕ×÷Ϊ²ÎÊý´«µ½new Date()ÀïÉú³ÉÈÕÆÚÀàÐÍ£»
Èç¹ýûÓÐÌØÊâ·Ö¸ô·û£¬¿ÉÒÔÓÃsubstr£¨x£¬y£©·½·¨À´È¡×Ó×Ö·û´®À´Éú³ÉÈÕÆÚ£¬substr£¨x£¬y£©Àx±íʾȡ×Ö´®µÄ¿ªÊ¼Î»Öã¬y±íʾ×Ó´®µÄ³ ......

JavaScript£ºprototypeÊôÐÔʹÓ÷½·¨

Ò»¡¢»ù±¾Ê¹Ó÷½·¨
      prototypeÊôÐÔ¿ÉËãÊÇJavaScriptÓëÆäËûÃæÏò¶ÔÏóÓïÑÔµÄÒ»´ó²»Í¬Ö®´¦¡£
¼ò¶øÑÔÖ®£¬prototype¾ÍÊǓһ¸ö¸øÀàµÄ¶ÔÏóÌí¼Ó·½·¨µÄ·½·¨”£¬Ê¹ÓÃprototypeÊôÐÔ£¬¿ÉÒÔ¸øÀද̬µØÌí¼Ó·½·¨£¬ÒÔ±ãÔÚJavaScriptÖÐʵÏÖ“¼Ì³Ð”µÄЧ¹û¡£
    & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ