资源描述:
《javascript 函数 网页js(javascript 函数 网页js)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、javascript函数网页js(javascript函数网页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.日期函数Javascript日期函数包括以下20个函数:(1)getd