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

javascriptµÄº¯Êýµ÷Óü̳ÐʵÏÖ

¿´µ½Ò»ÆªÈëÃŵÄJS¼Ì³ÐÎÄÕÂ,×ªÔØÏÂ
Ô­µØÖ·:http://sdcyst.javaeye.com/blog/288813
Àà±äÁ¿/Àà·½·¨/ʵÀý±äÁ¿/ʵÀý·½·¨
ÏȲ¹³äÒ»ÏÂÒÔǰд¹ýµÄ·½·¨:
ÔÚjavascriptÖÐ,ËùÓеķ½·¨¶¼ÓÐÒ»¸öcall·½·¨ºÍapply·½·¨.ÕâÁ½¸ö·½·¨¿ÉÒÔÄ£Äâ¶ÔÏóµ÷Ó÷½·¨.ËüµÄµÚÒ»¸ö²ÎÊýÊǶÔÏó,ºóÃæµÄ
²ÎÊý±íʾ¶ÔÏóµ÷ÓÃÕâ¸ö·½·¨Ê±µÄ²ÎÊý(ECMAScript specifies two methods that are defined for all functions, call()
and apply(). These methods allow you to invoke a function as if it were a method of some other object. The first
argument to both call() and apply() is the object on which the function is to be invoked; this argument becomes
the value of the this keyword within the body of the function. Any remaining arguments to call() are the values
that are passed to the function that is invoked).±ÈÈçÎÒÃǶ¨ÒåÁËÒ»¸ö·½·¨f(),È»ºóµ÷ÓÃÏÂÃæµÄÓï¾ä:
f.call(o, 1, 2);
×÷ÓþÍÏ൱ÓÚ
o.m = f;
o.m(1,2);
delete o.m;
¾Ù¸öÀý×Ó:
Js´úÂë < type="application/x-shockwave-flash" width="14" height="15" src="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" src="http://www.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=function%20Person(name%2Cage)%20%7B%20%20%2F%2F%E5%AE%9A%E4%B9%89%E6%96%B9%E6%B3%95%0A%20%20%20%20this.name%20%3D%20name%3B%0A%20%20%20%20this.age%20%3D%20age%3B%0A%7D%0Avar%20o%20%3D%20new%20Object()%3B%20%20%20%2F%2F%E7%A9%BA%E5%AF%B9%E8%B1%A1%0Aalert(o.name%20%2B%20%22_%22%20%2B%20o.age)%3B%20%2F%2Fundefined_undefined%0A%0APerson.call(o%2C%22sdcyst%22%2C18)%3B%20%2F%2F%E7%9B%B8%E5%BD%93%E4%BA%8E%E8%B0%83%E7%94%A8%3Ao.Person(%22sdcyst%22%2C18)%0Aalert(o.name%20%2B%20%22_%22%20%2B%20o.age)%3B%20%2F%2Fsdcyst_18%0A%0APerson.apply(o%2C%5B%22name%22%2C89%5D)%3B%2F%2Fapply%E6%96%B9%E6%B3%95%E4%BD%9C%E7%94%A8%E5%90%8Ccall%2C%E4%B8%8D%E5%90%8C%E4%B9%8B%E5%A4%84%E5%9C%A8%E4%BA%8E%E4%BC%A0%E9%80%92%E5%8F%82%E6%95%B0%E7%9A%84%E5%BD%A2%E5%BC%8F%E6%98%AF%E7%94%A8%E6%95%B0%E7%BB%84%E6%9D%A5%E4%BC%A0%E9%80%92%0Aalert(o.name%20%2B%20%22_%22%20%2B%20o.age)%3B%20%2F%2Fname_89" qua


Ïà¹ØÎĵµ£º

asp.net×¢²áJavascriptµÄ·½·¨

1¡¢IsStartupScriptRegistered£º¶ÔÏóÊÇ·ñ×¢²áÁËÆôÓýű¾¡£
2¡¢IsClientScriptBlockRegistered£º¶ÔÏóÊÇ·ñ×¢²áÁ˿ͻ§¶Ë½Å±¾¿é¡£
3¡¢IsClientScriptIncludeRegistered£º¶ÔÏóÊÇ·ñ×¢²áÁ˿ͻ§¶Ë½Å±¾°üº¬¡£
µÚÒ»¸öÀý×Ó£º
string info = "<script>alert('ÄãºÃÂð£¿');</script>";
//ÅжÏʼþÊÇ·ñ±»×¢²á£¬Ð´ÈëÇ ......

javascriptдÀ෽ʽ֮¶þ

2¡¢Ô­ÐÍ·½Ê½
/**
* PersonÀࣺ¶¨ÒåÒ»¸öÈË£¬ÓиöÊôÐÔname£¬ºÍÒ»¸ögetName·½·¨
*/
function Person(){}
Person.prototype.name = "jack";
Person.prototype.getName = function() { return this.name;}

°ÑÀàµÄÊôÐÔ£¨×ֶΣ©£¬·½·¨¶¼¹ÒÔÚprototypeÉÏ¡£
Ô켸¸ö¶ÔÏó²âÊÔÏ£º
var p1 = new Person();
var ......

javascriptдÀ෽ʽ֮Èý

È¡Ç°ÃæÁ½ÖÖµÄÓŵ㣺
a¡¢Óù¹Ô캯ÊýÀ´¶¨ÒåÀàÊôÐÔ£¨×ֶΣ©
b¡¢ÓÃÔ­ÐÍ·½Ê½À´¶¨ÒåÀàµÄ·½·¨¡£
¾ÍÓÐÁ˵ÚÈýÖÖ·½Ê½¡£ÕâÖÖ·½Ê½Ã²ËƲÉÓõÄÈ˽϶ࡣ
3¡¢×ۺϹ¹Ô캯Êý/Ô­ÐÍ
/**
* PersonÀࣺ¶¨ÒåÒ»¸öÈË£¬ÓиöÊôÐÔname£¬ºÍÒ»¸ögetName·½·¨
* @param {String} name
*/
function Person(name) {
this.name = name;
}
Pers ......

VB.NET/C# and JavaScript communication

Introduction
This article is about passing data between VB.NET/C# WinForms and JavaScript.
Before reading further, let me warn you that this article is not about ASP.NET. Concepts covered in the article are applied to Desktop applications.
Background
I was working on a project which required dat ......

javascript:void(0)

½ñÌì¿´µ½¡¶AJAX¿ª·¢¼òÂÔ¡·ÖÐËùÓеÄ<A href>¶¼Óõ½ÁËjavascript:void(0)
½ñÌì¿´ÁËÒ»ÏÂÔ­À´Õâ¸ö±í´ïʽµÄ×÷ÓþÍÊÇÈõ±Ç°Õâ¸ö³¬Á´½Ó³ÉΪһ¸öËÀÁ´½Ó£¬¾ÍÊÇʲô¶¼²»×÷¡£
ÒÔÏÂÕª×Ô£º
http://blog.csdn.net/mouyong/archive/2007/01/24/1491761.aspx
±ðÈËЩµÄJavaScript½Å±¾¿ÉÒÔ¿´µ½ÕâÑùµÄ´úÂ룺
<a href="javascript ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ