JavascriptÖеÄarguments ¶ÔÏó
function
fn(a,b,c)
{
var
s
=
""
;
var
i;
s
+=
"
º¯Êý´«Èë²ÎÊý¸öÊý:
"
+
fn.arguments.length
+
"
\n
"
;
for
(i
=
0
;i
<
fn.arguments.length;i
++
)
{
s
+=
"
º¯Êý´«Èë²ÎÊý
"
+
i
+
"
:
"
+
fn.arguments[i]
+
"
\n
"
;
}
s
+=
"
º¯Êýʵ¼Ê²ÎÊý¸öÊý:
"
+
fn.arguments.callee.length
+
"
\n
"
;
document.all.t.innerText
=
s
}
Ïà¹ØÎĵµ£º
ÔÚJavaScriptÖÐûÓжàάÊý×éµÄ¸ÅÄî
µ«ÊÇ¿ÉÒÔÄ£ÄâʵÏÖ
1ά
//1 ²»ÄÜÈ·¶¨Êý×élengthµÄÇé¿öÏ£¬ÏÈÉùÃ÷Ò»¸öÊý×éÃû£¬È»ºóÔÙÖð¸ö¸³Öµ¡£
var tArray=new Array();
tArray[0]='A';
tArray[1]='2';
//2 ÖªµÀÈ·ÇеÄlength£¬´´½¨Êý×é
var tArray=new Array(10);
//3 ´´½¨Êý×éµÄͬʱ²¢¸³Öµ
var tArray=new Array('A','2','3', ......
$wnd and $doc Calling native JavaScript with JSNI
$wnd ÊÇʲô£¿
GWT provides the $wnd and $doc variables to refer to the window and document objects
GWTʹÓÃͨ¹ýJava Native methodʹÓÃËü£¬ÉùÃ÷Ò»¸önative·½·¨£¬½«º¬ÓÐJavaScriptµÄ·½·¨Ìå×¢ÊÍ¡£±àÒëÆ÷½«×¢ÊÍ¿éÄÚµÄÄÚÈÝÖð×ÖÊä³ö£¬Ê¹Ö®Óë±àÒë²úÉúµÄJavaScriptÕûº ......
×¢Ò⣺readOnlyÖеÄOÒª´óд
//Ò³Ãæ³õʼ»¯Â¼È룬ÅжÏÖ¸±ê˵Ã÷ÊÇ·ñΪ¹¤×ÊÐÔÖ§³ö¡£
function init() {
var mark = "<%=mark%>";
//Èç¹ûÖ¸±ê˵Ã÷Ϊ“¹¤×ÊÐÔÖ§³ö”£¬Ôò¹¤×ÊÖ§³öÄÇÒ»Ïî±äΪֻ¶Á£¬ÇÒֵΪ“Ö¸±ê¿ÉÓýð¶î”£»ÆäËû¼Èë¿ò¶¼²»¿É¼Èë¡£
......
ÑéÖ¤Îı¾¿òÄÚÈݲ»ÄÜΪ¿Õ
<input onblur="if(this.value.replace(/^ +| +$/g,'')=='')alert('²»ÄÜΪ¿Õ!')">
Ö»ÄÜÊäÈëÓ¢ÎĺÍÊý×Ö
<input onblur="if(/[^0-9a-zA-Z]/g.test(value))alert('Óдí')">
<input onkeyup="value=value.replace(/[^0-9a-zA-Z]/g,'')"/>
<input type="text" onkeyup="value ......