varHr= "; varUrl= "http://www.baidu.com/about/news.php"; varIndex=url.indexof (". php");//gets the string. The subscript value of PHPdocument.write (url.substring (index));//outputs the end of the specified subscript string with the substring methoddocument.write (HR); varstr= "JavaScript"; varLen=str.length;//gets the length of the string for(varI=len-1;i>=0;--i) {//backward traversal of output from the end of a stringdocument.write (Str.charat (i));//the output string corresponds to the underlying value} document.write (HR); vartoday=NewDate (); varDays=today.gettime ();//gets the current system time varcomeday=NewDate ("1994-09-02");//Create Birth Time varcomedays=Comeday.gettime (); varNow=days-comedays;//subtract the time of birth from the current time to get the median differenceNow=math.ceil (NOW/1000/3600/24);//milliseconds converted to days, and then Ceil method to take up the whole document.write ("Distance Birth date 1994-09-02 already:" +now+ "Days! "); document.write (HR); //var username=window.prompt ("Please enter user name! "); //var Panduan = function () {//Now the variable is a function //var arr=["*", "%", "&", "<", ">", "!", "@", "#"; //var len=arr.length;//gets the length of the array //var strlen=username.length;//gets the string length of the user input //For (Var i=0;i<strlen;++i) { //For (Var j=0;j<len;++j) { //If (Arr[j]==username.charat (i)) {//Determines whether the characters in the array are the same as the characters entered by the user //return 0; // } // } // } //return 1; // }; //If (Panduan (username)) {//Call Note if function parentheses //alert ("The user name is legal! "); //}else { //alert ("The user name is illegal! "); // } vararr=[1,5,13,11,23,34,20]; vartrun=function(A, b) {returnA-b; } document.write (Arr.sort (Trun)); document.write (HR); vartoday=NewDate (); //var year=today.getfullyear ();//Year 4 bit //var moth=today.getmonth ();//month //var data=today.getdate ();//Date //var week=today.getday ();//0-6 weeks //var hours=today.gethours ();//hour //var miu=today.getminutes ();//Minutes //var sec=today.getseconds ();//sec //var secc=today.getmilliseconds ();//milliseconds varTodays=today.tolocalestring ();//output Current system time Datedocument.write ("Today is:" +todays); document.write (HR); varstr= "Guangzhou Chuan Zhi Education, is a professional training of educational institutions!" "; varre=/education/g;//Regular Expressions don't quite understanddocument.write (Str.replace (Re, ' education '));//Repace replacing a specified character
Today's homework, the overall is still possible ...