Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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


Ïà¹ØÎĵµ£º

JavaScript »ñÈ¡¶ÔÏóµÄ¸ß¶ÈºÍ¿í¶ÈÏêϸ˵Ã÷

scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐÄ¿Ç°¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetL ......

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 ......

JavaScript£ºprototypeÊôÐÔʹÓÃ˵Ã÷

prototype ÊÇÔÚ IE 4 ¼°ÆäÒÔºó°æ±¾ÒýÈëµÄÒ»¸öÕë¶ÔÓÚijһÀàµÄ¶ÔÏóµÄ·½·¨£¬¶øÇÒÌØÊâµÄµØ·½±ãÔÚÓÚ£ºËüÊÇÒ»¸ö¸øÀàµÄ¶ÔÏóÌí¼Ó·½·¨µÄ·½·¨£¡ÕâÒ»µã¿ÉÄÜÌýÆðÀ´»áÓеãÂÒ£¬±ð¼±£¬ÏÂÃæÎÒ±ãͨ¹ýʵÀý¶ÔÕâÒ»ÌØÊâµÄ·½·¨×÷ÒÑϽ²½â£º
¡¡¡¡Ê×ÏÈ£¬ÎÒÃÇÒªÏÈÁ˽âÒ»ÏÂÀàµÄ¸ÅÄJavaScript ±¾ÉíÊÇÒ»ÖÖÃæÏò¶ÔÏóµÄÓïÑÔ£¬ËüËùÉæ¼°µÄÔªËظù¾ÝÆäÊôÐÔµ ......

ѧϰ±Ê¼Ç JavaScript»ù´¡

JavaScript»ù´¡
stringObject.charAt(index)·½·¨£º·µ»ØÖ¸¶¨Ë÷ÒýλÖô¦µÄ×Ö·û¡£
stringObject.slice(start,[end])ºÍstringObject.substring(start,[end])·½·¨¶¼½ÓÊÜÁ½¸ö²ÎÊý£¬·Ö±ðΪ×Ó×Ö·û´®µÄÆðʼλÖúÍÖÕֹλÖ㬷µ»ØÕâÁ½ÕßÖ®¼äµÄ×Ö·û´®£¬²»°üÀ¨ÖÕֹλÖõÄÄǸö×Ö·û´®¡£Èç¹û²»Ö¸¶¨µÚ¶þ¸ö²ÎÊý£¬ÔòĬÈÏΪ×Ö·û´®µÄ³¤¶È£¬¼´ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ