JavaScript¸ß¼¶³ÌÐòÉè¼ÆÑ§Ï°±Ê¼Ç2£º Ä£Ä⺯ÊýÖØÔØ
ÓÃarguments¶ÔÏó¼ì²â´«µÝ¸øº¯ÊýµÄ²ÎÊý¸öÊý£ºarguments.length
function test(){
if(arguments.length == 1)
alert(arguments[0] + "£¬ÄãºÃ");
else if(arguments.length == 2)
alert(arguments[0] + "," + arguments[1] + "£¬ÄãÃǺÃ")
else
alert("´ó¼ÒºÃ");
}
test(); //Êä³ö: ´ó¼ÒºÃ
test("a"); //Êä³ö: a£¬ÄãºÃ
test("a","b"); //Êä³ö: a,b,ÄãÃǺÃ
test("a","b","c","d"); //Êä³ö: ´ó¼ÒºÃ
Ïà¹ØÎĵµ£º
´úÂëʾÀý
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>ÎÞ±êÌâÎĵµ</title>
</head>
<mce:style><!--
.man{ float:left; background:#9af; margin:3px; padding:3px; cursor:default}
--></mce:style>< ......
flex ºÍjavascript»¥Ïàµ÷Óá£
Ò»¡¢flex µ÷ÓÃjavascript
Ö»ÐèʹÓþ²Ì¬µÄExternalInterface.call¾Í¿ÉÒÔÁË¡£
call ·½·¨ÖÁÉÙÒªÇóÒ»¸ö²ÎÊý£¬¾ÍËùµ÷ÓöÊýµÄÃû³Æ¡£
Ò²¿ÉÒÔ´«µÝ²ÎÊý¡£
È磺
ExternalInterface.call("alert","hello");
"hello"¾ÍÊÇ×÷Ϊalertµ ......
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>¹ö¶¯ÐÂÎÅÀà</title>
<style type="text/css">
body {
  ......
×ªÔØ×Ô£ºhttp://hikejun.com/blog/?p=536
Zakas 1/22ÔÚtwitterÉÏ·ÖÏíÁËBaranovskiyµÄһƪÎÄÕ“So, you think you know JavaScript?
”£¨ÄãÈÏΪÄã¹»Á˽âjavascriptÂ𣩱êÌâºÜ½Ð°å¡£½á¹û5С¶Î´úÂë×öµÄÏ¡ÀﻩÀ²¡£
½ñÌìZakasרÃÅ׫ÎĽâ´ðÁËÕ⼸µÀÌ⣨http://www.nczonline.net/blog/2010/01/26/answering-baranov ......