資源描述:
《javascript 函數(shù) 網(wǎng)頁(yè)js(javascript 函數(shù) 網(wǎng)頁(yè)js)》由會(huì)員上傳分享,免費(fèi)在線(xiàn)閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫(kù)。
1、javascript函數(shù)網(wǎng)頁(yè)js(javascript函數(shù)網(wǎng)頁(yè)js)Share:JavaScriptfunctionDaquanBaiduspace_applicationplatformMypersonalhomepagefriendsaeoae
2、messagecenter
3、
4、dresssetoutAeoaeArticles,albums,HOHOphotos,PK,sharing,voting,testinggifts,pets,happytribes,carfactories,colorfulfishM
5、oreWebgameAddsettingsSharinghot,sharinglatest,sharingfriends,sharing,sharingandfeedbackGoodcitizensshareandshareJavaScriptfunctionDaquanJavaScriptfunctionscanbedividedintofivecategories:GeneralfunctionArrayfunctionDatefunctionMathematicalfunctionStringfunct
6、ion1.generalfunctionTheJavaScriptroutinefunctionconsistsofthefollowing9functions:(1)alertfunction:displaysawarningdialogbox,includingaOKbutton.(2)confirmfunction:displaysaconfirmationdialog,includingtheOKandCancelbuttons.(3)escapefunction:convertscharacters
7、intoUnicodecodes.(4)Evalfunction:calculatingtheresultofanexpression.(5)isNaNfunction:thetestis(true),no(false)isnotanumber.(6)parseFloatfunction:convertsstringsintocharacternumbers.(7)parseIntfunction:convertsstringsintointegernumbers(whichcanbespecifiedinh
8、exadecimalnumbers).(8)promptfunction:displaysaninputdialogboxthatpromptsforuserinput.Suchas:Script>(9)theunescapefunctiondecodesthecharactersencodedby
9、theescapefunction.2.arrayfunctionTheJavaScriptarrayfunctionconsistsofthefollowing4functions:(1)joinfunction:convertandconnectallelementsinanarraytoastring.Cases:Function,JoinDemo(){VaR,a,b;A=new,Array(0,1,2,3,4);B=a.join("-");//delimiterReturn(b);//returnb=
10、=0-1-2-3-4"}(2)lengthfunction:returnsthelengthofthearray.Cases:Function,LengthDemo(){VaR,a,l;A=new,Array(0,1,2,3,4);L=a.length;Return(L);//l==5}(3)reversefunction:invertthearrayelementsinreverseorder.Cases:Function,ReverseDemo(){VaR,a,l;A=new,Array(0,1,2,3,
11、4);L=a.reverse();Return(L);}(4)sortfunction:reorderthearrayelements.Cases:Function,SortDemo(){VaR,a,l;A=newArray("X","y","Z","D","V","M","R");L=a.sort();Return(L);}3.日期函數(shù)Javascript日期函數(shù)包括以下20個(gè)函數(shù):(1)getd