<div class="codetitle"> <span><a style="CURSOR: pointer" data="77135" class="copybut" id="copybut77135" onclick="doCopy('code77135')"><u>複製程式碼</u></a></span> 程式碼如下:</div> <div class="codebody" id="code77135"> <br><script type="text/javascript"> <BR>function fnfunction (name){ <BR>if(typeof name === "string"){ <BR>var args = Array.prototype.slice.call( arguments, 1 ); <BR>for(var i=0;i< args.length;i ){ <BR>alert(args[i]);//結果: 111 222 <BR>} <BR>} <BR>} <BR>function callFn(){ <BR>fn(" test",111,222); <BR>} <BR>callFn(); <BR></script> <br> </div>