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

javascript Óë C# »¥Ïàµ÷ÓÃ

ºÜ¶àÈ˶¼ÏòÔÚ·þÎñÆ÷
¶Ëµ÷Óÿͻ§¶ËµÄº¯ÊýÀ´²Ù×÷£¬Ò²¾ÍÊÇÔÚaspÖе÷ÓÃjava
script½Å±¾ÖÐÒѾ­¶¨ÒåºÃµÄ½Å±¾º¯Êý¡£¾­¹ýÑо¿£¬·¢ÏÖÁËһЩÃãÇ¿µÄ·½·¨¡£
1.
ÓÃResponse.Write·½·¨Ð´Èë½Å±¾
±ÈÈçÔÚÄãµ¥»÷°´Å¥ºó£¬ÏȲÙ×÷Êý¾Ý¿â
£¬ÍêÁ˺óÏÔʾÒѾ­Íê³É£¬¿ÉÒÔÔÚ×îºóÏëµ÷Óõĵط½Ð´ÉÏ
Response.Write("<script type='text/javascript'>alert();</script>");
Õâ¸ö·½·¨ÓиöȱÏݾÍÊDz»Äܵ÷Óýű¾Îļþ
ÖÐ
µÄ×Ô¶¨ÒåµÄº¯Êý£¬Ö»Äܵ÷ÓÃÄÚ²¿º¯Êý£¬¾ßÌåµ÷ÓÃ×Ô¶¨ÒåµÄº¯ÊýÖ»ÄÜÔÚResponse.WriteдÉϺ¯Êý¶¨Ò壬±ÈÈç
Response.Write("<script type='text/javascript'>function
myfun(){...}</script>");
2.
ÓÃClientScriptÀද̬Ìí¼Ó½Å±¾
Ó÷¨ÈçÏ£ºÔÚÏëµ÷ÓÃij¸öjavascript½Å±¾º¯ÊýµÄµØ·½Ìí¼Ó´úÂ룬עÒâÒª±£Ö¤MyFunÒѾ­Ôڽű¾ÎļþÖж¨Òå¹ýÁË¡£
    ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>MyFun();</script>");
Õâ¸ö·½·¨±ÈResponse.Write¸ü·½±ãһЩ£¬¿ÉÒÔÖ±½Óµ÷Óýű¾ÎļþÖеÄ×Ô¶¨Ò庯Êý¡£
3.
ÆÕͨµÄÌí¼Ó¿Ø¼þµÄAttributesÊôÐÔ
¶ÔÓÚÆÕͨ°´Å¥¾ÍÊÇ£ºButton1.Attributes.Add("onclick","MyFun();");
Ö»ÄÜÔÚOnloadÖлòÀàËÆÓÚonloadµÄ³õʼ»¯¹ý³ÌÖÐÌí¼Ó²ÅÓÐЧ¡£¶øÇÒÊÇÏÈÖ´Ðнű¾º¯Êý£¬ÎÞ·¨¸Ä±äÖ´ÐÐ˳Ðò¡£
×¢Ò⣬ÒÔÉÏËùÓз½·¨ÖУ¬ºǫ́´úÂ붼²»ÄÜÓÐת»¯µ±Ç°Ò³µÄ´úÂ룬±ÈÈçRedirectµÈ£¬Òª°Ñתҳ´úÂë·ÅÔڽű¾ÀïÃæ
 
 
ÎÊ£º
1.
ÈçºÎÔÚ
JavaScript
·ÃÎÊ
C#
º¯Êý
?
2.
ÈçºÎÔÚ
JavaScript
·ÃÎÊ
C#
±äÁ¿
?
3.
ÈçºÎÔÚ
C#
ÖзÃÎÊ
JavaScript
µÄÒÑÓбäÁ¿
?
4.
ÈçºÎÔÚ
C#
ÖзÃÎÊ
JavaScript
º¯Êý
?
ÎÊÌâ
1
´ð°¸ÈçÏ£º
javaScript
º¯ÊýÖÐÖ´ÐÐ
C#
´úÂëÖеĺ¯Êý£º
·½·¨Ò»£º
1
¡¢Ê×ÏȽ¨Á¢Ò»¸ö°´Å¥£¬ÔÚºǫ́½«µ÷Óûò´¦ÀíµÄÄÚÈÝдÈë
button_click
ÖÐ
;
2
¡¢ÔÚǰ̨дһ¸ö
js
º¯Êý£¬ÄÚÈÝΪ
doc
ument.getElementById("btn1").click();
3
¡¢ÔÚǰ̨»òºǫ́µ÷ÓÃ
js
º¯Êý£¬¼¤·¢
click
ʼþ£¬µÈÓÚ·ÃÎʺǫ́
c#
º¯Êý£»
·½·¨¶þ£º
1
¡¢º¯ÊýÉùÃ÷Ϊ
public
ºǫ́´úÂë
(
°Ñ
public
¸Ä³É
protected
Ò²¿ÉÒÔ
)
public string ss()
{
return("a");
}
2
¡¢ÔÚ
html
ÀïÓÃ
<%=fucntion()% >
¿ÉÒÔµ÷ÓÃ

ǰ̨½Å±¾
&l


Ïà¹ØÎĵµ£º

javascriptʼþ²éѯ×ÛºÏ

click() ¶ÔÏó.click() ʹ¶ÔÏó±»µã»÷¡£
closed ¶ÔÏó.closed ¶ÔÏó´°¿ÚÊÇ·ñÒѹرÕtrue/false
clearTimeout(¶ÔÏó) Çå³ýÒÑÉèÖõÄsetTimeout¶ÔÏó
clearInterval(¶ÔÏó) Çå³ýÒÑÉèÖõÄsetInterval¶ÔÏó
confirm("ÌáʾÐÅÏ¢") µ¯³öÈ·ÈÏ¿ò£¬È·¶¨·µ»ØtrueÈ¡Ïû·µ»Øfalse
cursor:Ñùʽ ¸ü¸ÄÊó±êÑùʽ hand crosshair text wait help defa ......

ATLÓëJavaScript½»»¥

Ô­ÌûµØÖ·£ºhttp://www.followman.com/bbs/Topic-B11-T262.aspx
JavaScript¶¯Ì¬ÏìÓ¦ATLʼþ
Ïà¹ØÌÖÂÛ:http://topic.csdn.net/t/20061012/21/5078729.html
ÖØ
µã£º½Å±¾´«¹ýÀ´µÄ¶ÔÏóÊÇIDispatch½Ó¿Ú£¬Ó¦¸ÃÓÃIDispatch::InvokeÀ´µ÷Óá£Èç¹û´«¹ýÀ´µÄÊǸöfunction£¬ÄÇôDISPID
Ϊ0£¬Èç¹ûÊǸö¶ÔÏó£¬ÄÇôҪÏÈÓÃGetIDsOfNamesµÃ ......

JavaScript±Ê¼Ç

ä¯ÀÀÆ÷ÒѾ­¿´µ½µÄ¶«Î÷¶¼´æÔÚ»º´æÎļþ¼ÐÀï¡£
½Å±¾×¢ÊÍ: µ¥ÐÐ// ¶àÐÐ/*....*/
Æô¶¯Ê±ºò¼ÓÔØfunction()      window.onload= function;
alert Ìáʾ¶Ô»°¿ò alert("ÌáʾÄÚÈÝ");
promptÌáʾÊäÈë¿òprompt("ÌáʾÄÚÈÝ","ĬÈÏÖµ")£»
   
JavaScriptÖض¨Ïò ÔÚ×°ÔØÒ³Ãæʱ£¬²»ÄÜÔÚ×°ÔØÍêÖ ......

javascript »ñÈ¡·þÎñÆ÷ʱ¼ä

µ±ÐèÒªÔÚÍøÒ³ÖÐÏÔʾʱ¼äʱ¿ÉÒÔÓõ½ÏÂÃæÕâ¶Î´úÂ룺
<SCRIPT language=JavaScript type=text/JavaScript>
var day="";
var month="";
var ampm="";
var ampmhour="";
var myweekday="";
var year="";
mydate=new Date();
myweekday=mydate.getDay();
mymonth=mydate.getMonth()+1;
myday= mydate.getDate(); ......

SunÈÏΪC#²»»áÌæ´úJava

SunÈÏΪC#²»»áÌæ´úJava ¡¡Õª×Ô£ºÎÒ°®ÄϹϸçÍøÕ¾¡¡ Microsoft(΢Èí¹«Ë¾)˵¡ÃC#ͬJava²»Ò»Ñù£¬½«³ÉΪһ¸ö¹ú¼ÊÐÔ±ê×¼¡£ ¡¡¡¡C#ͬJava½ÏÁ¿µÄµÚÒ»¾Ö±ÈÈüÒѾ­¿ªÊ¼£¬Sun¹«Ë¾Éù³ÆMicrosoftÒѾ­¸øÒ»¸ö²»Ïà¹ØµÄ±ê׼ίԱ»áµÝ½»ÁËÒ»¸öÁíÈË»ìÏýµÄ¡¢²»ÍêÉƵļ¼Êõ±ê×¼¡£ ¡¡¡¡Sun¹«Ë¾µÄ¹¤³ÌʦÃÇ×ÔMicrosoft¹«Ë¾ÓÚÐÇÆÚÒ»·¢²¼ÁËC#±ê×¼ÒÔÀ´£¬Ò» ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ