Common JavaScript code (8) and javascript code
Article from "PHP Chinese network"
101. Pie Chart
<Style>
V \: * {behavior: url (# default # VML )}
O \: * {behavior: url (# default # VML )}
. Shape {behavior: url (# default # VML )}
</Style>
<Script language = "javascript">
Function show (pie)
{
Pie. strokecolor = pie. fillcolor;
Pie. strokeweight = 10;
Div1.innerHTML = "<font size = 2 color = red>" + pie. id + "</font> <font size = 2>" + pie. title + "</font> ";
}
Function hide (pie)
{
Pie. strokecolor = "white ";
Pie. strokeweight = 1;
Div1.innerHTML = "";
}
</Script>
</Head>
<Body>
<V: group style = 'width: 5 cm; height: 5cm 'coordorigin = '0, 0' coordsize = '2013'>
<V: shape id = 'asp technical' style = 'width: 10; height: 10; top: 10; left: 0' title = 'number of votes: 6: 40.00%'
Onmouseover = 'javascript: show (this); 'onmouseout = 'javascript: hide (this); 'href = 'HTTP: // www.cnADO.com'
CoordSize = '10, 10' strokecolor = 'white' fillcolor = '# ffff33'> <v: path v ='m 300,200 AE
300,200,200,150, xe '/> </v: shape>
<V: shape id = 'php' style = 'width: 10; height: 10; top: 10; left: 0 'title = 'Number of votes: 1 ratio: 6.67%'
Onmouseover = 'javascript: show (this); 'onmouseout = 'javascript: hide (this); 'href = 'HTTP: // www.cnADO.com'
CoordSize = '10, 10' strokecolor = 'white' fillcolor = '# ff9933'> <v: path v ='m 300,200 AE
300,200,200,150,943 7184,1572864 xe '/> </v: shape>
<V: shape id = 'jsp 'style = 'width: 10; height: 10; top: 10; left: 0 'title =' Number of votes: 2 ratio: 13.33%'
Onmouseover = 'javascript: show (this); 'onmouseout = 'javascript: hide (this); 'href = 'HTTP: // www.cnADO.com'
CoordSize = '10, 10' strokecolor = 'white' fillcolor = '# 3399ff'> <v: path v ='m 300,200 AE
300,200,200,150,110 10048,3145728 xe '/> </v: shape>
<V: shape id = 'C # written. netWEB program 'style = 'width: 10; height: 10; top: 10; left: 0' title = 'Votes: 3 ratio: 100'
Onmouseover = 'javascript: show (this); 'onmouseout = 'javascript: hide (this); 'href = 'HTTP: // www.cnADO.com'
CoordSize = '10, 10' strokecolor = 'white' fillcolor = '#99ff33'> <v: path v ='m 300,200 AE
300,200,200,150,141 55776, xe '/> </v: shape>
<V: shape id = 'vb.. net write. netWEB program 'style = 'width: 10; height: 10; top: 10; left: 0' title = 'Votes: 2 ratio: 100'
Onmouseover = 'javascript: show (this); 'onmouseout = 'javascript: hide (this); 'href = 'HTTP: // www.cnADO.com'
CoordSize = '10, 10' strokecolor = 'white' fillcolor = '# ff6600'> <v: path v ='m 300,200 AE
300,200,200,150,188 74368,3145728 xe '/> </v: shape>
<V: shape id = 'xml technical' style = 'width: 10; height: 10; top: 10; left: 0' title = 'number of votes: 1: 6.67%'
Onmouseover = 'javascript: show (this); 'onmouseout = 'javascript: hide (this); 'href = 'HTTP: // www.cnADO.com'
CoordSize = '10, 10' strokecolor = 'white' fillcolor = '# ff99ff'> <v: path v ='m 300,200 AE
300,200,200,150,220 20096,1572864 xe '/> </v: shape>
</V: group>
<V: group style = 'width: 6 cm; height: 6cm 'coordorigin = '0, 0' coordsize = '2013'>
<V: rect style = 'height: 10; width: 15; top: 0; left: 10' fillcolor = '# ffff33'/>
<V: rect style = 'height: 28; width: 100; top: 0; left: 30 'stroked = 'false'> <v: textbox
Style = 'fontsize: 2'> asp technology </v: textbox/> </v: rect>
<V: rect style = 'height: 10; width: 15; top: 30; left: 10' fillcolor = '# ff9933'/>
<V: rect style = 'height: 28; width: 100; top: 30; left: 30 'stroked = 'false'> <v: textbox
Style = 'fontsize: 2'> php </v: textbox/> </v: rect>
<V: rect style = 'height: 10; width: 15; top: 60; left: 10' fillcolor = '# 3399ff'/>
<V: rect style = 'height: 28; width: 100; top: 60; left: 30 'stroked = 'false'> <v: textbox
Style = 'fontsize: 2'> jsp </v: textbox/> </v: rect>
<V: rect style = 'height: 10; width: 15; top: 90; left: 10' fillcolor = '#99ff33'/>
<V: rect style = 'height: 28; width: 100; top: 90; left: 30 'stroked = 'false'> <v: textbox
Style = 'fontsize: 2'> c #. netWEB program written </v: textbox/> </v: rect>
<V: rect style = 'height: 10; width: 15; top: 120; left: 10' fillcolor = '# ff6600'/>
<V: rect style = 'height: 28; width: 100; top: 120; left: 30 'stroked = 'false'> <v: textbox style = 'fontsize: 2 '> vb.net
Written. netWEB Program </v: textbox/> </v: rect>
<V: rect style = 'height: 10; width: 15; top: 150; left: 10' fillcolor = '# ff99ff'/>
<V: rect style = 'height: 28; width: 100; top: 150; left: 30 'stroked = 'false'> <v: textbox style = 'fontsize: 2'> xml Technology
</V: textbox/> </v: rect>
</V: group>
<Div style = "position: absolute; left: 10; top: 10; width: 760; height: 16">
<Table border = "1" cellpadding = "2" cellspacing = "2" cellpadding = "0" cellspacing = "0"
Style = "border-collapse: collapse" bordercolor = "# CCCCCC" width = "100%" ID = "Table1">
<Tr>
& Lt; td width = "100%" id = div1 & gt; & lt;/td & gt;
</Tr>
</Table>
</Div> //
102. It is a special container. you can install a webpage
<Button> <iframe src = "http://www.google.com/"> </iframe> </button> // button
103. External html code
Event. srcElement. outerHTML //
104. trigger that identifies the current IE event
Event. srcElement and event. keyCode //
105. Event Type
Event. type //
106. dynamically change the type
<Style>
. Overnone {border-width: 0; background-color: darkblue; cursor: default; color: gold; width: 115}
. Outnone {border-width: 0; background-color: white; cursor: default; width: 115}
</Style>
<Input class = Outnone onmouseover = this. className = 'overnone'> //
107. Page flip
<Html dir = rtl>
108. scrolling
Parent. scroll (x, y );//
<Body onload = "s = 0" onDblClick = "s = setInterval ('scrollby (0, 1) ', 10)" onClick = "clearInterval (s)"> //
109. Change the status bar
Self. status = "";//
110. Change the window size
Window. resizeTo (200,300 );//
111. Change the mouse Style
Style
BODY {CURSOR: url ('mouse. wan ');
SCROLLBAR-BASE-COLOR: #506AA8;
SCROLLBAR-ARROW-COLOR: # 14.0f;
}//
112. Transparent background
<Input type = "button" value = "Button" style = "background-color: transparent; border: 0;"> //
113. The mouse is in the waiting shape
<Input type = button onclick = "this. style. cursor = 'wait'"> //
114. Call the function of the parent window
Opener. fucntion1 ();//
115. Internal html code of the body
<Input type = "button" onclick = "alert(code.doc ument. body. innerHTML)" value = "View"> //
116. Call the function of the parent window in the framework
<Input type = 'button 'onclick = 'parent. test (); 'value = 'Call the parent window function'> //
117. Exchange Node
<Table width = 200 height = 200 border>
<Tr> <td id = c1> CELL_1 </td> </tr>
<Tr> <td id = c2> CELL_2 </td> </tr>
</Table>
<Br>
<Input type = "button" value = "swap row" onclick = "c1.swapNode (c2)"> //
118. delete a node
<Table width = 200 height = 200 border>
<Tr id = trall> <td id = c1> CELL_1 </td> </tr>
<Tr> <td id = c2> CELL_2 </td> </tr>
</Table>
<Br>
<Input type = "button" value = "swap row" onclick = "trall. removeNode (c2)"> //
119. Add a node
AddNode ()//
120. Obtain the Parent and Child tags of the event.
Event. srcElement. children [0] and event. srcElement. parentElement //
121. Change the color of buttons in a set
<Style>
Button {benc: expression (this. onfocus = function () {this. style. backgroundColor = '# E5F0FF ';})}
</Style>
<Button> New </button> //