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

C#´úÂëÓëjavaScriptº¯ÊýµÄÏ໥µ÷ÓÃ

C#´úÂëÓëjavaScriptº¯ÊýµÄÏ໥µ÷ÓÃ
ÎÊ£º
1.ÈçºÎÔÚJavaScript·ÃÎÊC#º¯Êý?
2.ÈçºÎÔÚJavaScript·ÃÎÊC#±äÁ¿?
3.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptµÄÒÑÓбäÁ¿?
4.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptº¯Êý?
ÎÊÌâ1´ð°¸ÈçÏ£º
javaScriptº¯ÊýÖÐÖ´ÐÐC#´úÂëÖеĺ¯Êý£º
·½·¨Ò»£º1¡¢Ê×ÏȽ¨Á¢Ò»¸ö°´Å¥£¬ÔÚºǫ́½«µ÷Óûò´¦ÀíµÄÄÚÈÝдÈëbutton_clickÖÐ;
2¡¢ÔÚǰ̨дһ¸öjsº¯Êý£¬ÄÚÈÝΪdocument.getElementById("btn1").click();
3¡¢ÔÚǰ̨»òºǫ́µ÷ÓÃjsº¯Êý£¬¼¤·¢clickʼþ£¬µÈÓÚ·ÃÎʺǫ́c#º¯Êý£»
·½·¨¶þ£º1¡¢º¯ÊýÉùÃ÷Ϊpublic
ºǫ́´úÂë(°Ñpublic¸Ä³ÉprotectedÒ²¿ÉÒÔ)
public string ss()
{
return("a");
}
2¡¢ÔÚhtmlÀïÓã¼%=fucntion()%£¾¿ÉÒÔµ÷ÓÃ
ǰ̨½Å±¾
£¼script language=javascript£¾
var a = "£¼%=ss()%£¾";
alert(a);
£¼/script£¾
·½·¨Èý£º1¡¢£¼script language="javascript"£¾
£¼!--
function __doPostBack(eventTarget, eventArgument)
{
var theForm = document.Form1; //Ö¸runat=serverµÄform
theForm.__EVENTTARGET.value = eventTarget;
thefrom.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
--£¾
£¼/script£¾
£¼input id="Button1" type="button" name="Button1" value="°´Å¥" onclick="javascript:__doPostBack('Button1','')"£¾
·½·¨ËÄ£º£¼script language="javascript"£¾
function SubmitKeyClick()
{
if (event.keyCode == 13)
{
event.cancelBubble = true;
event.returnValue = false;
document.all.FunName.value="ÄãÒªµ÷Óõĺ¯ÊýÃû"£»
document.form[0].submit();
}
}
£¼/script£¾
£¼INPUT onkeypress="SubmitKeyClick()" id="aaa" type="text"£¾
£¼input type="hidden" name="FunName"£¾ ¡´£¡--ÓÃÀ´´æ´¢ÄãÒªµ÷Óõĺ¯Êý --¡µ
ÔÚ.CSÀïÓУº
public Page_OnLoad()
{
if (!Page.IsPost())
{
string strFunName=Request.Form["FunName"]!=null?Request.Form["FunName"]:"";
//¸ù¾Ý´«»ØÀ´µÄÖµ¾ö¶¨µ÷ÓÃÄĸöº¯Êý
switch(strFunName)
{
case "enter()":
enter() ; //µ÷Óøú¯Êý
break;
case "ÆäËû":
//µ÷ÓÃÆäËûº¯Êý
break;
default:
//µ÷ÓÃĬÈϺ¯Êý
break;
}
}
}
public void enter()
{
//……±ÈÈç¼ÆËãijֵ
}
ÎÊÌâ2.ÈçºÎÔÚJavaScript·ÃÎÊC#±äÁ¿?
´ð°¸ÈçÏ£º
·½·¨Ò»£º1¡¢Í¨¹ýÒ³ÃæÉÏÒþ²ØÓò·ÃÎÊ£¼input id="xx" type="hidden" runat="server"£¾
·


Ïà¹ØÎĵµ£º

javascript withÓ÷¨(ת)

with
(object)
   statements
²ÎÊý
object
еÄĬÈ϶ÔÏó¡£
statements
Ò»¸ö»ò¶à¸öÓï¾ä£¬object ÊǸÃÓï¾äµÄĬÈ϶ÔÏó¡£
˵Ã÷
with
Óï¾äͨ³£ÓÃÀ´Ëõ¶ÌÌض¨ÇéÐÎϱØÐëдµÄ´úÂëÁ¿¡£ÔÚÏÂÃæµÄÀý×ÓÖУ¬Çë×¢Òâ Math µÄÖظ´Ê¹Óãº
x = Math.cos(3 * Math.PI) + Math.sin(Math.LN10)
y = Math.tan(14 * ......

javascript ºÏ²¢Êý×é

<html>
<body>
<script type="text/javascript">
var arr = new Array(3)
arr[0] = "George"
arr[1] = "John"
arr[2] = "Thomas"
var arr2 = new Array(3)
arr2[0] = "James"
arr2[1] = "Adrew"
arr2[2] = "Martin"
document.write(arr.concat(arr2))
</script>
</body>
</ ......

JavascriptµÄhistory¶ÔÏó

history¶ÔÏó3¸ö·½·¨back()¡¢forward()ºÍgo()£¬ÕâЩ·½·¨¿ÉÒÔµ÷ÓÃÀúÊ·±íÖаüº¬µÄÎĵµ¡£
back()·½·¨×°ÈëÀúÊ·±íÖеÄÇ°Ò»¸öÒ³Ã棬µÈЧÓÚä¯ÀÀÆ÷ÖеÄBack°´Å¥
forward()·½·¨×°ÈëÀúÊ·±íÖеĺóÒ»¸öÒ³Ã棬µÈЧÓÚä¯ÀÀÆ÷ÖеÄForward°´Å¥
go()·½·¨½øÈëÀúÊ·±íÖеÄÌض¨Îĵµ£¬¿ÉÒÔÈ¡ÕûÐβÎÊý»ò×Ö·û´®²ÎÊý
go(n)n>0ʱ£¬×°ÈëÀúÊ·±íÖÐµÄ ......

JavaScript Óõ½alert³öÂÒÂëÎÊÌâ

             response.write "<script language='javascript'>"
             response.write "alert('Óû§Ãû»òÃÜÂë´íÎó!');"
             response.write "hist ......

C#ѧϰ¼°ÓëdelphiµÄ±È½Ï£¨Ò»£©

¸Õ¿ªÊ¼ºÜ²»Ï°¹ßc#µÄ·ç¸ñ£¬°¥£¬ÏÈÈëΪÖ÷°¡£¬delphiÏ°¹ßÁË£¬{}´úÌæbegin/endÌ«ÔúÑÛ¡£
ÊôÐÔ·½·¨µÄÐû¸æºÍ´úÂëÔÚÒ»Æð£¬Ã»ÓÐÏñdelphi·Öinterface/implementation£¬¸Ð¾õÌ«ÂÒ£¬¶¼²»ÖªµÀÒ»¸öclassµ½µ×Óм¸¸ö·½·¨¡£
ÿ¸öÊôÐԺͷ½·¨Ç°Ã涼Ҫµ¥¶Àдprivate/protected/public£¬ÀÏÌ죬c#ÊÇdelphiÖ®¸¸Éè¼ÆµÄÞÞ£¬Ôõô²»Ñ§delphiдһ¸ö¾ÍÐÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ