Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Application Programming


    

Blue Forest http://www.lslnet.com at 8:28 on August 25, 2006

[Switch -- all source code

Qinghua University published -- "get javascript> series, I knock out according to the books, some translated a bit. A few years ago looked at them, no matter the recent re-thumbed and helpful. The book should have a CD-ROM, but school books, CDs do not know which. Want to help you to learn Javascript

Javascript Chapter 1 Introduction
1. Javascript language input in the address column
Javascript:Document.write ( "display characters")
2. Javascript will be embedded in HTML
"Script language=javascript>
Document.bgColor= "blue"
"/script>
Array variables and the use of Chapter 2
1. Variable Declaration
"Script language=javascripe>
Var answer1, answer2, answer3, answer4;
Answer1=9;
Answer2=2.5
Answer3= "Milkey May"
Answer4=true
"/script>
2. Use integer
"Script language=javascript>
Var decimalNum, hexadecimalNum, octalNum
DecimalNum=24
HexadecimalNum=0x24
OctalNum=024
Document.write ( "display metric :" + decimalNum+ "" School Official Cites Use ")
Document.write ( "indicates hexadecimal system :" hexadecimalNum + +, "" School Official Cites Use ")
Document.write ( "eight to 229 :" octalNum + +, "" School Official Cites Use ")
"/script>
3. Float use
"Script language=javascript>
Var num1 and num2, num3, num4
Num1=1234567890000.0
Num2=5.14e23
Num3=0.0000123456
Num4=6.0254e3-4
Document.write ( "Float 1 :" +num1+ "" School Official Cites Use ")
Document.write ( "Float 2 :" +num2+ "" School Official Cites Use ")
Document.write ( "Float 3 :" +num3+ "" School Official Cites Use ")
Document.write ( "Float 4 :" +num4+ "" School Official Cites Use ")
"/script>
4. Use Boolean values
"Script language=javascript>
Var answer1, answer2
Answer1=true
Answer2=false
Document.write ( "Boolean 1 show :" +answer1+ "" School Official Cites Use ")
Document.write ( "Boolean two shows :" +answer2+ "" School Official Cites Use ")
"/script>
5. Use string
"Script language=javascript>
Var str1 and str2
Str1= "fdsgdg dsfdsf china,"
Str2= "Radio and TV University Wuhan City"
Document.write ( "string 1 show :" +str1+ "" School Official Cites Use ")
Document.write ( "display string 2 :" +str2+ "" School Official Cites Use ")
"/script>
6. Identify types of variables
"Script>
Var answer1, answer2, answer3, answer4
Answer1=9
Answer2=2.5
Answer3= "milky may"
Answer4=true
Document.write ( "type 1 variable is :" + +typeof answer1 "" School Official Cites Use ")
Document.write ( "two types of variables :" +typeof answer2 + "" School Official Cites Use ")
Document.write ( "three types of variables :" +typeof answer3 + "" School Official Cites Use ")
Document.write ( "four types of variables :" +typeof answer4 + "" School Official Cites Use ")
"/script>
7. String will be converted into digital
"Script>
Var str1= "31 days in january"
Var int1=parseInt (str1)
Document.write ( "str1 data type is :" +typeof str1+ "" School Official Cites Use ")
Document.write ( "int1 data type is :" +typeof int1+ "" School Official Cites Use ")
"/script>
8. Will be converted into string figures
"Script>
Var int1=256
Var str1= "" +int1
Document.write ( "str1 data type is :" +typeof str1+ "" School Official Cites Use ")
Document.write ( "int1 data type is :" +typeof int1+ "" School Official Cites Use ")
"/script>
9. Array statement
"Script>
Array=new Array (5)
Array[0]=1
Array[1]=3
Array[2]=5
Array[3]=7
Array[4]=11
Document.write ( "Array :" +array[0]+ "" +array[1]+ "" +array[2]+ "" +array[3]+ "" +array[4])
"/script>
10. Determine the number of array elements
"Script>
Array=new Array (5)
Array[0]=1
Array[1]=3
Array[2]=5
Array[3]=7
Array[4]=11
Document.write ( "Array :" +array[0]+ "" +array[1]+ "" +array[2]+ "" +array[3]+ "" +array[4]+ "" School Official Cites Use ")
Document.write ( "is the number of array elements" +array.length)
"/script>
11. Will be converted to string array
"Script>
Array=new Array ()
Array[0]= "dark"
Array[1]= "aroma"
Array[2]= "nebula"
Array[3]= "water"
Str1=array.join ()
Str2=array.join ( "")
Document.write (str1+ "" School Official Cites Use ")
Document.write (str2)
"/script>
12. Classification of Array
"Script>
Array=new Array ()
Array[0]= "dark"
Array[1]= "aroma"
Array[2]= "nebula"
Array[3]= "water"
Str1=array.sort ()
Document.write (str1+ "" School Official Cites Use ")
"/script>
Chapter III established formula
1. Use arithmetic operator
"Script>
Var1=12
Var2=10
Varadd=var1+var2
Varsub=var1-var2
Varmult=var1*var2
Vardiv=var1/var2
Varmod=var1%var2
Document.write ( "data 1 is :" +var1+ "" School Official Cites Use ")
Document.write ( "Data 2 :" +var2+ "" School Official Cites Use ")
Document.write ( "data together :" +varadd+ "" School Official Cites Use ")
Document.write ( "data reduction :" +varsub+ "" School Official Cites Use ")
Document.write ( "data multiplied :" +varmult+ "" School Official Cites Use ")
Document.write ( "data eliminate :" +vardiv+ "" School Official Cites Use ")
Document.write ( "data eliminate take more than a few :" +varmod+ "" School Official Cites Use ")
"/script>
2. Variable and variable rate decrease
"Script>
Days=1
Document.write ( "output variables" +days+ "" School Official Cites Use ")
Days++
Document.write ( "incremental after variables into :" +days)
"/script>
3. Create more expression
"Script>
Daysofmonth=28
If (daysofmonth==28)
Month= "february"
Document.write ( "days of the month :" +daysofmonth+ "" School Official Cites Use ")
Document.write ( "month :" +month)
"/script>
4. Create logical expression
"Script>
Dayofmonth=28
If (dayofmonth==28 | | dayofmonth==29)
Month= "february"
Document.write ( "days of the month :" +dayofmonth+ "" School Official Cites Use ")
Document.write ( "month :" +month)
"/script>
5. Operators use conditions
"Script language=" Javascript ""
Stomach= "hungry";
Time= "5:00";
(Stomach== "hungry" &&time== "5:00")? Eat = "dinner" : eat= "a snack";
Document.write ( "output" +eat);
"/script>
6. Recognition figures
"Script>
Var1=24;
(IsNaN (var1)) ?document.write ( "variable var1" +var1+ "does not figure") : Document.write ( "variable var1" +var1+ "digital")
"/script>
Chapter IV flow control procedures
1. IF -Else use words
"Script>
Month= "december"
Date=25
If (month== "december", named date==25)
Document.write ( "Today is Christmas, closed shops")
Else
Document.write ( "welcome to your shopping")
"/script>
2. Used for recycling
"Script>
For (count=1;count<=10;count++)
Document.write ( "export its" +count+ "sentence" + "" School Official Cites Use ")
"/script>
3. While the use of circle
"Script>
Count=1
While (count<=15) (
Document.write ( "export its" +count+ "sentence" + "" School Official Cites Use ")
Count++}
"/script>
4. Interruption
"Script>
Count=1
While (count<=15) (
Count++
If (count==8)
Break;
Document.write ( "export its" +count+ "sentence" + "" School Official Cites Use "))
"/script>
5. Continue cycle
"Script>
Count=1
While (count<=15) (
Count++
If (count==8)
Continue;
Document.write ( "export its" +count+ "sentence" + "" School Official Cites Use "))
"/script>
6. Timer use Javascript
"Script>
Was co-function ()
{document.write ( "Export words")
}
"/script>
"Onload=window.setTimeout body (was co (), 5000)"
7. Set up at regular intervals
"Script>
Window.setInterval ( "document.form1.text2.value=document.form1.text1.value", 3000)
"/script>
"Form name=form1>
"Input type=text name=text1><br>
"Input type=text name=text2><br>
"/form>
8. Eliminate overtime and spacing
"Script>
Stop=window.setInterval ( "document.form1.text2.value=document.form1.text1.value", 300)
"/script>
"Form name=form1>
"Input type=text name=text1><br>
"Input type=text name=text2><br>
"Input type=button name=button1 value=" elimination of overtime and spacing "onclick=clearInterval (stop)"
"/form>
Use function V
1. Statement function
"Script>
Function quote ()
(Document.write ( "export words")
}
"/script>
2. Call Function
"Script>
Function quote ()
(Document.write ( "export words")
}
Quote ()
"/script>
3. Overall understanding of variables and local variables
Any statement not var keyword overall variables are variables, the variables are any statement in the overall function outside variables
4. Will be transmitted to the function parameters
"Script>
Function f (item)
{document.write ( "Output parameters" +item+ "" School Official Cites Use ")
}
F ( "fgdfgd")
F ( "second parameter")
"/script>
5. Return values from functions
"Script>
Function average (var1, var2, var3)
{ave= (Var1+var2+var3) /3;
Document.write ( "output");
Return ave;
}
Document.write (average (34,56,78))
"/script>
6. Calling function through HTML links
"Script>
Quote function () (
Document.write ( "output string")
}
"/script>
"A href=javascript:quote ()" function call through HTML links "</a>
"A href=javascript:Document.write (" export characters ")," Calling function through HTML link directly to write Javascript phrase "</a>
Chapter 6 dealing with the incident
1. Shoot inspection mouse
"Form name=form1>
"Input type=button name=button1 value=hello onclick=document.form1.button1.value= 'there'"
"/form>
2. Detection of double
"Form name=form1>
"Input type=button name=button1 value=hello onclick=document.form1.button1.value=, 'Shoot the button' ondblclick=document.form1.button1.value=, 'Double-click the button'"
"/form>
3. Creating hover button
"<img Src=go.gif onmouseover=document.images[0].src= 'go2.gif' onmouseout= document.images[0].src= 'go.gif'"
4. Detection Press
"Form name=form1>
"Input type=text name=text1 value=hello onkeypress=" if (window.event.keyCode== '100') document.form1.text1.value= 'd you press the key' ""
"/form>
5. Installed focus
"Form name=form1>
"Input type=text name=text1 value=hello
Onfous=document.form1.text1.value= 'focus is the text box'
Onblur=document.form1.text1.value= 'lost its focus in the text box' "
"/form>
6. Detection of pull-down menu options
"Form name=form1>
"Size=4 select name=select1
OnChange=document.form1.text1.value=document.form1.select1.value>
"Option value=" Beijing "and" Beijing "/option>
"Option value=" Shanghai "and" Shanghai "/option>
"Option value=" Wuhan "," Wuhan "/option>
"Option value=" Tianjin, "and" Tianjin "/option>
"Option value=" Dalian "and" Dalian "/option>
"/select>
"Input tppe=text name=text1 value=hello>
"/form>
7. Set up a webpage loading and unloading information
"Body onload=document.form1.text1.value= 'pages loaded' onunload=alert ( 'Good-bye, welcome again')"
"Form name=form1>
"Input type=text name=text1 value=" page is loaded : : ""
"/form>
Chapter VII target
1. \ Object attributes and methods of understanding
"Body bgcolor=" green ""
"Script>
Document.write ( "page background color is :" +document.bgColor)
Document.write ( "color page prospects :" +document.fgColor)
"/script>
2. Use of targeted website elements
"Script>
"/script>
"Form name=form1>
"Textarea name=ta1>dfgfdgfdhfdhdfdfgdf</textarea>
"Input type=button value=" opt-text "onclick=document.form1.ta1.select ()"
"Input type=button value=" show version "onclick=document.write (document.form1.ta1.value)"
"/form>
3. The use of sub-objects
"Form name=form1>
"Input type=text name=text1 value=hello>
"/form>
"Script>
Document.form1.text1.value= "gdfgfd"
"/script>

"Form name=form1>
"Input type=radio name=radio1> men
"Input type=radio name=radio2> woman
"/script>
"Script>
Document.form1.radio1.checked=true
"/script>
4. Use predefined objects
"Script>
Str1= "dgdfgdfgdfhf fixation fixation efforts to attack the law"
Document.write (str1+ "" School Official Cites Use ")
Str2=str1.substr (5)
Document.write (str2+ "" School Official Cites Use ")
Document.write ( "export Circle area :" +Math.PI*Math.pow (5.0,2))
"/script>
5. Creating a new object
"Script>
Today=new Date ()
Document.write ( "Today is the" + (today.getMonth () + 1) + "on" +today.getDate () + "Japan" + "" School Official Cites Use ")
Document.write ( "now is :" +today.toLocaleString ())
"/script>
. 6. Under the current targets
"Form name=form1>
"Input type=text name=text1 value=" dgdgdfgfd "onclick=this.select ()"
"/script>
7. Object Attributes check
"Script>
For (proposito in window)
{document.write ( "Window. "+prop+" = "+window[prop]+" "School Official Cites Use") ;}
For (prop2 in location)
{document.write ( "Location. "+prop2+" = "+location[prop]+" "School Official Cites Use") ;}
"/script>
8. Object Array use
"Script>
Array=new Array (10)
Array[0]= "bark"
Array[1]= "aroma"
Array[2]= "nebula"
Array[3]= "cookie"
Array[4]= "technology"
Document.write ( "the number of array elements" +array.Length+ "" School Official Cites Use ")
Document.write ( "Array will join with the merger" +array.join ( "") + "" School Official Cites Use ")
Document.write ( "Array classified" +array.sort ())
"/script>
9. The use of image objects
"> <img Src=**.gif" : Photo suggested. "Border=10>
"Script>
Document.write ( "pictures suggest :" +document.images[0].alt+ "" School Official Cites Use ")
Document.write ( "picture frame size :" +document.images[0].broder)
"/script>
10. Pre-loading image
"Script>
Freddy=new Image ()
Freddy.src=freddy.gif
"/script>
"Body onload=document.images[0].src=freddy.src>
, "Various factions of the party yesterday signed a" blank.gif ""
"/body>
11. Image change
"<img Src=freddy.gif><br>
"Form name=form1>
"Input type=button name=button1 value=" change the image "onclickd=document.images[0].src=dudjp.gif>
"/form>
12. And the use of link anchor objects
"Name=anchor1> anchor a 1<br>
"A href=http://www.microsoft.com>Microsoft</a><br>
"A href=http://www.sohu.com>sohu</a><br>
"A href=http://www.sina.com.cn>sina</a><br>
"Script>
Document.write ( "the total pages" +document.links.length+ "link" + "" School Official Cites Use ")
Document.write ( "the total pages" +document.anchors.length+ "anchor" + "" School Official Cites Use ")
Document.write ( "Agreement is a link" +document.links[0].protocol+ "" School Official Cites Use ")
Document.write ( "Path is a link" +document.links[0].pathnamel+ "" School Official Cites Use ")
Document.write ( "a link href" +document.links[0].hrefl+ "" School Official Cites Use ")
"/script>
13. Links change
"A href =http://www.microsoft.com>link</a>
"Form name=form1>
"Input type=button name=button1 value=" change the link "onclick=document.links[0].href= 'http://www.sohu.com'"
"/form>
14. Object use history
"Form name=form1>
"Input type=button name=button1 value=" able to return to Page 2 "onclick=window.history.go (2)"
"/form>
Chapter VIII of the use of window
1. The last column shows the state in the browser version
"Onload=window.status= body," Welcome to my site ""
"A href=http://www.sohu.com>sohu</a>
"/body>
2. Change the background color
"Script>
Document.bgColor= "orange"
"/script>
3. Listed background color
"=green> Body bgColor
"Script>
Document.write ( "current background color is :" +document.bgColor)
"/script>
"/body>
4. Change the color of text and links
"Script>
Document.bgColor= "orange"
Document.fgColor= "blue"
Document.linkColor= "red"
"/script>
"H2> see this color version of the" /h2>
"A href=http://www.sohu.com>sohu</a>
"/body>
5. Document title change
"Script>
Name="_ftn1" "Mouse"
Document.title= "welcome to" +name+ " 's House"
Document.write (document.title)
"/script>
6. Show date changes
"Script>
Document.write ( "the page was last revised" +document.lastModified)
"/script>
7. Document URL address current
"Script>
Document.write ( "the URL of the page :" +document.URL)
"/script>
8. See page cited
"Script>
Document.write ( "the HTML page is invoked" +document.referrer)
"/script>
9. Opening up a new browser window
"Script>
Window.open ( "*.htm", "title" and "width=200, height=400, resizable=yes")
"/script>
10. Remote window closing
Close.html :
"Script>
Document.write ( "text")
"/script>
"Form name=form1>
"Input type=button name=button1value=" closed "onclick=window.close ()"
"/form>

Open.html
"Script>
Window.open ( "close.html", "romote", "width=200, height=400, resizable=yes")
"/script>
11. Print Window
"Script>
Document.write ( "text")
"/script>
"Form name=form1>
"Input type=button value= onclick=window.print print ()"
"/form>
12. Moving Window
"Form name=form1>
Horizontal direction "input type=text name=x value=20>
Vertical direction "input type=text name=y value=50>
"Input type=button value=" moving window : "onclick=window.moveTo (document.form1.x.value, document.form1.y.value)"
"/form>

"Form name=form1>
Horizontal direction "input type=text name=x value=20>
Vertical direction "input type=text name=y value=50>
"Input type=button value=" moving window "onclick=window.moveBy (document.form1.x.value, document.form1.y.value)"
"/form>
13. Change the window size
"Form name=form1>
Horizontal direction "input type=text name=x value=200>
Vertical direction "input type=text name=y value=500>
"Input type=button value=" : to change the window size. . "Onclick=window.resizeTo (document.form1.x.value, document.form1.y.value)"
"/form>

"Form name=form1>
Horizontal direction "input type=text name=x value=200>
Vertical direction "input type=text name=y value=500>
"Input type=button value=" change the window size "onclick=window.resizeBy (document.form1.x.value, document.form1.y.value)"
"/form>
14. Dialog notify the user with a warning
"Script>

Window.alert ( "welcome")
"/script>
15. Dialog with suggested accept input
"Script>
Name=window.prompt (or "names", "name")
Document.write ( "You are welcome :" +name+ "here")
"/script>
16. Confirmation dialog so that users with decision
"Script>
Like=window.confirm ( "You feel alright? ")
If (like==true)
Document.write ( "Thank you for your praise")
Else
Document.write ( "I hope you get the praise")
"/script>
Chapter IX use string
1. Use string object
"Script>
Mystring= "gdgdfgfddddaaaaaaaaaaaabbbbbbbbbbbbbbbbbvbhg.<br>"
Document.write (mystring)
Document.write (mystring.bold ())
Document.write (mystring.toUpperCase ())
"/script>
2. Use subsequence
"Script>
Str1= "fdsf 1111 gfdgfd dfdsf cccc dddd.<br>"
Document.write (str1)
Document.write (str1.substring (0,13) + "" School Official Cites Use ")
Document.write (str1.substr (20,11) + "" School Official Cites Use ")
"/script>
3. Link string
"Script>
Str1= "may you find"
Str2= "peace, happiness and prosperity.<br>"
Document.write (str1+ "" School Official Cites Use ")
Document.write (str2)
Document.write (str1.concat (str2))
Document.write (str1+=str2)
"/script>
4. Formatted string variables
"Script>
Str1= "peace, happiness and prosperity.<br>"
Document.write (str1)
Document.write (str1.big ())
Document.write (str1.small ())
Document.write (str1.bold ())
Document.write (str1.italics ())
Document.write (str1.strike ())
Document.write (str1.fontsize (6))
Document.write (str1.fontcolor (green))
"/script>
5. Creating links and anchors
"Script>
Str1= "this is the bigginning of the page.<br>"
Str2= ":. "School Official Cites Use"
Str3= "this is the end of the page. "School Official Cites Use"
Str4= "link to the start<br>"
Str5= "link to the end<br>"
Document.write (str1.anchor ( "start"))
For (i=0;i<10;i++)
Document.write (str2);
Document.write (str3.anchor ( "end"))
Document.write (str4.link ( "#start"))
Document.write (str5.link ( "#end"))
"/script>
6. Determine the length of string
"Script>
Str1= "this is the bigginning of the page. "
Document.write (str1+ "" School Official Cites Use ")
Document.write ( "length of the string is :" +str1.length)
Document.write ( "string is all capital; "+str1.toUpperCase ())
Document.write ( "string is all lowercase; "+str1.toLowerCase ())
"/script>
7. Within the search string
"Script>
Str1= "this is the end of the line.<br>"
Document.write (str1)
Document.write ( "characters end position in the string is" +str1.search ( "end"))
Document.write ( "string of characters, the location of the dog" +str1.search ( "dog"))
"/script>
8. Location string of characters
"Script>
Str1= "spring is a time for Flowers and trees and Baby bunnles<br>"
Document.write (str1)
Document.write ( "the index for the second word 'and' is" +str1.indexOf ( "and", 30))
Documednt.write ( "the last index of the word 'and' is" +str1.lastIndexOf ( "and"))
"/script>
9. Replace the text string
"Script>
Str1= "spring is a time for Flowers and trees and Baby bunnles<br>"
Document.write (str1)
Document. Write (str1.replace ( "and", ""))
"/script>
10. String separation
"Script>
Str1= "spring is a time for Flowers and trees and Baby bunnles<br>"
Document.write (str1)
Str1array=str1.split ( "")
Document.write (str1array[0]+ "" School Official Cites Use ")
Document.write (str1array[1]+ "" School Official Cites Use ")
Document.write (str1array[2]+ "" School Official Cites Use ")
Document.write (str1array[3]+ "" School Official Cites Use ")
"/script>
Date and time of use Chapter 10
1. Date targeted use
"Script>
Cdate=new Date (the "august 2,1989 12:30:00")
Document.write (cdate)
"/script>
2. Local time and date indicated
"Script>
Cdate=new Date ()
Document.write ( "The current time is :" +cdate.toGMTString () + "" School Official Cites Use ")
Document.write ( "Date and Time :" +cdate.toLocaleString ())
"/script>
3. Agreed time and date values
"Script>
Cdate=new Date ()
Document.write ( "show the week" +cdate.getDay () + "" School Official Cites Use ")
Document.write ( "display the current month" +cdate.getMonth () + "" School Official Cites Use ")
Document.write ( "display the current date" +cdate.getDay () + "" School Official Cites Use ")
Document.write ( "display the current year" +cdate.getYear () + "" School Official Cites Use ")
Document.write ( "display the current hours," +cdate.getHours () + "" School Official Cites Use ")
Document.write ( "the minutes show" +cdate.getMinutes () + "" School Official Cites Use ")
Document.write ( "the second show" +cdate.getSeconds () + "" School Official Cites Use ")
"/script>
4. Set up time and date values
"Script language=javascript>
Cdate=new Date ( "December 25,1984")
Document.write ( "show date" +cdate+ "" School Official Cites Use ")
Document.write ( "the establishment of the month" +cdate.setMonth (10) + "" School Official Cites Use ")
Document.write ( "date set up" +cdate.setDate (23) + "" School Official Cites Use ")
Document.write ( "installed Year" +cdate.setYear (2000) + "" School Official Cites Use ")
Document.write ( "installed hours," +cdate.setHours (13) + "" School Official Cites Use ");
Document.write ( "installed Minutes" +cdate.setMinutes (47) + "" School Official Cites Use ");
Document.write ( "installed seconds" +cdate.setSeconds (23) + "" School Official Cites Use ");
Document.write ( "display the date and time installed" +cdate);
"/script>
Chapter XI use Math Object
1. Use Math Object
"Script language=javascript>
"/script>
"Form name=form1>
Circle radius : "input type=text name=rad><br>
Circle area : "input type=text name=area><br>
"Input type=button name=button1 value= computing area onclick=document.form1.area.value=document.form1.rad.value*document.form1.rad.value*Math.PI>
"/form>
2. Random Number Generation
"Script>
Array1=new Array (
"This is the first sentence."
"This is the second sentence."
"This is the third sentence."
"This is the fourth sentence."
"This is the fifth sentence."
"This is the first sentence of 6")
RandomNo=Math.floor (array1.length*Math.random ())
Document.write ( "output of a random phrase" + "" School Official Cites Use "+array1[RandomNo])
"/script>
3. Use square root
"Form name=form1>
Value:<input type=text name=va1><br>
Square root of the "input type=text name=sqrt><br>
"Calculate square root of the input type=button name=button1 value=
Onclick= "document.form1.sqrt.value=Math.sqrt (document.form1.va1.value)," "
"/form>
4. The rounded figures
"Form name=form1>
Importation of the "input type=text name=val><br>
Rounding the results "input type=text name=round><br>
"Input type=button name=button1 value= results onclick=document.form1.round.value=Math.round (document.form1.val.value)"
"/form>
5. Involution operation
"Form name=form1>
Properly dealt with the "input type=text name=val><br>
Index "input type=text name=power><br>
Power "input type=text name=result><br>
"Input type=button name=button1 value= results onclick=" document.form1.result.value=Math.pow (document.form1.val.value. document.form1.power.value), ""
"/form>
6. Maximum and minimum found
"Form name=form1>
Digital 1<input type=text name=val1><br>
Digital 2<input type=text name=val2><br>
Minimum "input type=text name=min><br>
Maximum "input type=text name=max><br>
1<input type=button value= figures calculated onclick= "document.form1.min.value=Math.min (document.form1.val1.value. document.form1.val2.value) ;document.form1.max.value= Math.max (document.form1.val1.value. document.form1.val2.value), ""
"/form>
Chapter XII use Form
1. Use the text box
"Form name=form1>
"Input type=text value=" information, please "name=text1>
"/form>
"Script>
Document.write ( "Form text1 types :" +document.form1.text1.type+ "" School Official Cites Use ")
Document.write ( "Form text1 name :" +document.form1.text1.name+ "" School Official Cites Use ")
Document.write ( "Form text1 Radio :" +document.form1.text1.value+ "" School Official Cites Use ")
Document.write ( "Form text1 size :" +document.form1.text1.size+ "" School Official Cites Use ")
"/script>

"Form name=form1>
"Input here type=text name=text1 value=click
Onfocus=document.form1.text1.select () "
"/form>
2. Restrict the use of passwords
"Form name=form1>
"Input type=password name=pw1 value=daylight>
"/form>
"Script>
Document.write ( "Form pw1 types :" +document.form1.pw1.type+ "" School Official Cites Use ")
Document.write ( "Form pw1 name :" +document.form1.pw1.name+ "" School Official Cites Use ")
Document.write ( "Form pw1 value :" +document.form1.pw1.value+ "" School Official Cites Use ")
Document.write ( "Form pw1 size :" +document.form1.pw1.size+ "" School Official Cites Use ")
"/script>
3. Using hidden fields
"Form name=form1>
"Input type=hidden name=hid1 value=piece of eight>
"/form>
"Script>
Document.write ( "Form hid1 types :" +document.form1.hid1.type+ "" School Official Cites Use ")
Document.write ( "Form hid1 name :" +document.form1.hid1.name+ "" School Official Cites Use ")
Document.write ( "Form hid1 value :" +document.form1.hid1.value+ "" School Official Cites Use ")
"/script>
4. Regional use of text box
"Form name=form1>
"Textarea name=ta1>how many grains of sand are there in the sahara desert?</textarea>
"/form>
"Script>
Document.write ( "Form ta1 types :" +document.form1.ta1.type+ "" School Official Cites Use ")
Document.write ( "Form ta1 name :" +document.form1.ta1.name+ "" School Official Cites Use ")
Document.write ( "Form ta1 value :" +document.form1.ta1.value+ "" School Official Cites Use ")
Document.write ( "Form ta1 horizontal width :" +document.form1.ta1.cols+ "" School Official Cites Use ")
Document.write ( "Form ta1 vertical width :" +document.form1.rows.value+ "" School Official Cites Use ")
"/script>

"Form name=form1>
"Textarea name=ta1 rows=4 onfocus=" document.form1.ta1.select () "and" how many grains of sand are there in the sahara desert?</textarea>
"/form>
5. Use buttons
"Form name=form1>
"Input type=button name=button1 value= standard buttons"
"/form>
"Script>
Document.write ( "Form button1 types :" +document.form1.button1.type+ "" School Official Cites Use ")
Document.write ( "Form button1 name :" +document.form1.button1.name+ "" School Official Cites Use ")
Document.write ( "Form button1 value :" +document.form1.button1.value+ "" School Official Cites Use ")
"/script>

"Form name=form1>
"Input type=text name=text1 size=45><br>
"Input button onclick= type=button name=button1 value=panic" document.form1.text1.value= 'sittle down. count to 10 and take a deep breath ' ""
"/form>
6. Use replacement button
"Form name=form1>
"Input type=reset name=reset1 value=" rest form, ""
"/form>
"Script>
Document.write ( "Form reset1 types :" +document.form1.reset1.type+ "" School Official Cites Use ")
Document.write ( "Form reset1 name :" +document.form1.reset1.name+ "" School Official Cites Use ")
Document.write ( "Form reset1 value :" +document.form1.reset1.value+ "" School Official Cites Use ")
"/script>
7. Submit button use
"Form name=form1>
"Input type=submit name=submit1 value=" submit form ""
"/form>
"Script>
Document.write ( "Form submit1 types :" +document.form1.submit1.type+ "" School Official Cites Use ")
Document.write ( "Form submit1 name :" +document.form1.submit1.name+ "" School Official Cites Use ")
Document.write ( "Form submit1 value :" +document.form1.submit1.value+ "" School Official Cites Use ")
"/script>
8. Use complex electoral buttons
"Form name=form1>
"Input type=checkbox name=cb1" computer savvy?
"/form>
"Script>
Document.write ( "Form cb1 types :" +document.form1.cb1.type+ "" School Official Cites Use ")
Document.write ( "Form cb1 been chosen? : "+document.form1.cb1.checked+" "School Official Cites Use")
Document.write ( "Form cb1 name :" +document.form1.cb1.name+ "" School Official Cites Use ")
"/script>
9. Option Button use
"Form name=form1>
"Input type=radio name=radio1>male
"Input type=radio name=radio1>female
"/form>
"Script>
Document.write ( "button was a choice" +document.form1.radio1[0].checked+ "" School Official Cites Use ")
Document.write ( "the second button was chosen" +document.form1.radio1[1].checked+ "" School Official Cites Use ")
Document.write ( "button the name" + document.form1.radio1[0].name+ "" School Official Cites Use ")
Document.write ( "button and the number" +document.form1.radio1.length)
"/script>
10. Use option list
"Form name=form1>
"Size=4> select name=select1
"Option name=option1 value=lon>london, England</option>
"Option name=option2 value=dub>Dublin, Ireland</option>
"/select>
"/form>
"Script>
Document.write ( "the choice list of the names" +document.form1.select1.name+ "" School Official Cites Use ")
Document.write ( "choose the length of the list" +document.form1.select1.length+ "" School Official Cites Use ")
Document.write ( "option was chosen by the current list of index" +document.form1.select1.selectedIndex+ "" School Official Cites Use ")
Document.write ( "the size of the option list" +document.form1.select1.size+ "" School Official Cites Use ")
"/script>
11. Verify the validity of Form
"Script>
Peatlands function () (
If (document.form1.text1.value!= '-' | | '2' | | '3' | | 'four') (
Alert ( "Please input 1-4 integer")
}
}
"/script>
"Form name=form1>
Please input 1-4 integer :
"Input type=text name=text1 size=4 onchange=validate ()"
"/form>
12. Control Form Focus
"Form name=form1>
"Input type=text name=text1 value=where is you focus?><br>
"Input type=text name=text2 value=is there?><br>
"Input type=text name=text3 value=or maybe here?><br>
"Input type=button name=button1 value=" text box # 1 "onclick=document.form1.text1.focus ()" <br>
"Input type=button name=button2 value=" text box # 2 "onclick=document.form1.text2.focus ()" <br>
"Input type=button name=button3 value=" text box # 3 "onclick=document.form1.text3.focus ()" <br>
"/form>
Chapter 13 sub-columns using
Chapter XIV use navigator
1. Use navigator Object
"Script>
Document.write ( "navigator Object Attributes" + "" School Official Cites Use ")
Document.write ( "appcodename :" +navigator.appCodeName+ "" School Official Cites Use ")
Document.write ( "appname : :" +navigator.appName+ "" School Official Cites Use ")
Document.write ( "appversion :" +navigator.appVersion+ "" School Official Cites Use ")
Document.write ( "platform :" +navigator.platform+ "" School Official Cites Use ")
Document.write ( "userAgent :" +navigator.userAgent+ "" School Official Cites Use ")
"/script>
"Script>
Document.write ( "navigator object methods" + "" School Official Cites Use ")
Document.write ( "javaEnabled () :" +navigator.javaEnabled ())
"/script>
2. Check user browser
"Script>
If (navigator.appName.indexOf ( "Microsoft") !=-1) (
Document.write ( "IE browser is Microsoft's browser" + "" School Official Cites Use "))
Else if (navigator.appName.indexOf ( "Netscape") !=-1) (
Document.write ( "netscape browser is the netscape浏览器" + "" School Official Cites Use "))
If (navigator.appVersion.indexOf ( "4.0") !=-1) (
Document.write ( "you are using a version 4.0compatible CPU")
}
Else{
Document.write ( "this CPU is not compliant 4.0"))
"/script>
3. Detection of the operating system users
"Script>
If (navigator.platform.indexOf ( "win32") !=-1) (
Document.write ( "you are using a computer running Windows 95 or highter"))
Else{
Document.write ( "this computer is not running Windows 95 or higher"))
"/script>
4. The use of object location
"Script>
Document.write ( "location object attributes" + "" School Official Cites Use ")
Document.write ( "hash" +location.hash+ "" School Official Cites Use ")
Document.write ( "hostname" +location.hostname+ "" School Official Cites Use ")
Document.write ( "host" +location.host+ "" School Official Cites Use ")
Document.write ( "href" +location.href+ "" School Official Cites Use ")
Document.write ( "port" +location.port+ "" School Official Cites Use ")
Document.write ( "search" +location.search+ "" School Official Cites Use ")
"/script>

Re-loading website
"Form name=form1>
"Input type=button name=button1 value= re-loading home page onclick=location.reload>
"/form>
5. Use cookie
"Script>
Finction makecookie () (
If (!document.cookie) (
Name=prompt ( "Please input your name");
Document.cookie= "name="_ftn1"" +name+ "; ";}
}
"/script>

"Onload=makecookie body ()"
"Script>
Makecookie function () (
If (!document.cookie) (
Name=prompt ( "Please input your name")
Document.cookie= "name="_ftn1"" +name+ "; "
Namestart=document.cookie.indexOf ( "=");
Nameend=document.cookieindexOf ( "; ");
Document.writeln ( "your name is :" +document.cookie.substring (namestart+1, nameend) + ", the Organization Department Holds Press Conference")
}
}
"/script>

Wonderful

What can be selected in the draw, but it was useful. Li.

Work hard, so many are tired of knocking, some collectors

Tough, huh, huh. Plus 2 minutes.

Top landlord hard!

Really good
Top firm

Is pretty good.

Really good, collections ~ ~

"Script>
Var1=24;
(IsNaN (var1)) ?document.write ( "variable var1" +var1+ "does not figure") : Document.write ( "variable var1" +var1+ "digital")
"/script>

Once behind the document.

Gogocome said in a message

Thank you!

Seem to have plots : :
But it is a classic, thank you.

Haotie ah, ah mean not too top

- By not reading.




 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com