<div class="codetitle"> <span><a style="CURSOR: pointer" data="20278" class="copybut" id="copybut20278" onclick="doCopy('code20278')"><u>複製程式碼</u></a></span> 程式碼如下:</div> <div class="codebody" id="code20278"> <br><script language="JavaScript"> <><--<! <BR>function MArray() { <BR>this.length = MArray.arguments.length <BR>for (var i = 0; i < this.length; i ) <BR>this[i 1] = MArray.arguments [i]} <BR>var fArray = new MArray; <BR>fArray[0]="歡迎大家學習javascript這門語言!"; <BR>fArray[1]="歡迎大家學習html這門語言!" <BR>fArray[2]="歡迎大家學習asp這門語言!" <BR>fArray[3]="歡迎大家學習vbscript這門語言!" <BR>var x = 1; <BR>var y = 0; <BR>var msg1 = fArray[y]; <BR>function newsSee() { <BR>if (x==msg1.length 1) { <BR>y =1; <BR>if (y > 3 ) y=0; <BR>document.form1.news2.value=' '; <BR>msg1 = fArray[y]; <BR>x=0;} <BR>document.form1.news2.value=msg1. substring(0,x); <BR>x =1; <BR>setTimeout("newsSee() ",100); <BR>} <BR>// --> <BR></script> <br> <br><form name="form1"> <br><p align="center"><input type="text" name="news2" size="40"></p> <br> </form> <br> <br><br> </div>