1. Text box focus issue
onBlur: This event is generated when the input focus is lost
onFocus: When the input gets focus, the file is generated
Onchange: This event is generated when the text value changes.
Onselect: When the text is highlighted, the file is generated
<input type="text" value="Guo Qiang" onfocus="if(value=='Guo Qiang') {value=''}" onblur="if
(value=='') {value='Guo Qiang'}">The text disappears when clicking, and the text appears again when the focus is lost.
2. Special color of web buttons
<input type=button name="Submit1" value="Guo Qiang" size=10 class=s02
style="background-color:rgb(235,207,22)">
3. Color changes when the mouse is moved in and out
<input type="submit" value="find it" name="B1" onMouseOut=="blue"
onMouseOver=="red" class="button">
4. Flat buttons
<input type=submit value=subscribe style="border:1px solid :#666666; height:17px; width:25pt; font-size:9pt;
BACKGROUND-COLOR: #E8E8FF; color:#666666" name="submit">
5. Button color change
<input type=text name="nick" style="border:1px solid #666666; font-size:9pt; height:17px;
BACKGROUND-COLOR: #F4F4FF; color:#ff6600" size="15" maxlength="16">
6. Planar input box
<input type="text" name="T1" size="20" style="border-style: solid; border-width: 1">
7. Make the window into the specified size
<script>
(300,283);
</script>
8. Make the text scroll up and down
<marquee direction=up scrollamount=1 scrolldelay=100 onmouseover='()' onmouseout='()'
height=60>
<!-- head_scrolltext -->
<tr>
<td>
Republic
</table> <!-- end head_scrolltext -->
</marquee>
9. The status bar displays the status of the page
<base onmouseover="='Website Construction /' ;return true">
10. You can click on the text to realize the selection of radio options
<br>
<input type="radio" name="regtype" value="A03" >
<label for="A03"> Couples: Register two accounts at a time</label> <br>
11. You can write onclick events in the font in the text field
12. Print</a>Print web page
<a href='javascript: ()'>
13. Linear input box
<input type="text" name="key" size="12" value="keyword" onFocus=() onMouseOver=()
class="line">
14. Display the last modified date of the document
<script language=javascript>
function hi(str)
{
()
alert("hi"+str+"!")
}
</script>
15. Events can be triggered when the mouse is moved to the text
<html>
<head>
<script language="LiveScript">
<!-- Hiding
function hello() {
alert("Harrow!");
}
</script>
</head>
<body>
<a href="" onMouseOver="hello()">link</a>
</body>
</html>
16. The page color can be determined based on the options on the web page
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<SCRIPT>
<!--
function bgChange(selObj) {
newColor = [].text;
= newColor;
= -1;
}
//-->
</SCRIPT>
<BODY STYLE="font-family:Arial">
<B>Changing Background Colors</B>
<BR>
<FORM>
<SELECT SIZE="8" onChange="bgChange(this);">
<OPTION>Red
<OPTION>Orange
<OPTION>Yellow
<OPTION>Green
<OPTION>Blue
<OPTION>Indigo
<OPTION>Violet
<OPTION>White
<OPTION>pink
</SELECT>
</FORM>
</BODY>
</HTML>
17. Change the button's characteristics
<style type="text/CSS">
<!--
.style1 { font-size: 12px; background: #CCCCFF; border-width: thin thin thin thin; border-color: #CCCCFF
#CCCCCC #CCCCCC #CCCCFF}
.style2 { font-size: 12px; font-weight: bold; background: #CCFFCC; border-width: thin medium medium thin;
border-color: #CCFF99 #999999 #999999 #CCFF99}
-->
</style>
The code of this button is as follows:
<input type="submit" name="Submit" value="Submit" onmouseover="='style2'"
onmouseout="='style1'" class="style1">
18. Change the picture of the button.
<style type="text/css">
<!--
.style3 { font-size: 12px; background: url(image/); border: 0px; width: 60px; height: 22px}
.style4 { font-size: 12px; font-weight: bold; background: url(image/); border: 0px 0; width:
60px; height: 22px}
-->
</style>
The button code of this example is as follows:
<input type="submit" name="Submit2" value="Submit" onmouseover="='style4'"
onmouseout="='style3'" class="style3">
19. Print the page
<div align="center"><a class=content href="javascript:doPrint();">Print this manuscript</a></div>
20. You can write html language directly
("");
21. Change the color of the drop-down box
<select name="classid"
onChange="changelocation([].value)"
size="1" style="color:#008080;font-size: 9pt">
22. Go to the target URL
="http://guoguo"
23. Pass the form of the object
UpdateSN('guoqiang99267',)
function UpdateSN(strValue,strForm)
{
= strValue;
return false;
}
24. Text tags
<label for="AltName4"><input name="AltName" type="RADIO" tabindex="931"
>guoqiang99859</label>
25.layer2 is the component's ID, which can control whether the component is visible
('Layer2'). = "block";
('Layer2'). = "none";//
26. Add the page to favorite
<script language=javascript>
<!--
function Addme(){
url = """; //Your own homepage address
title = "Your Site Name"; //Your own homepage name
(url,title);
-->
</script>//
27. The page will be closed automatically after 10 seconds
< script language="JavaScript" >
function closeit() {
setTimeout("()",10000)
}
< /script >
28.Can compare the size of characters
char=(i);
if(!('0'<=char&&char<='9'))
29. Convert characters to numbers
month = parseInt(char)
30. When clicking the value non-empty option, turn to the specified connection
<select onchange='if(!="")()' class="textinput">
<option selected>sponsor</option>
<option>-----------------</option>
<option value="/">Beijing Daily</option>
<option value="/">Beijing Evening News</option>
</select>
31. Change the background color
<td width=* class=dp bgColor=#FAFBFC onmouseover="='#FFFFFF';"
onmouseout="='#FAFBFC';">
32. Change the background color of the text input box
<style>
.input2 {background-image: url('../images/'); font-size: 12px; background-color:
#D0DABB;border-top-width:1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px}
</style>
<input name=content type=text size="47" class="input2" maxlength="50">
33. Change the characteristics of horizontal lines
<hr size="0" noshade color="#C0C0C0">
34. The way to pass parameters
<a href="?CurPage=8&id=3488">8</a>
35. Jump within the page
<a href="#1">1</a>
<a href="#2">2</a>
<a href="#3">3</a>
<a href="#4">4</a>
<a href="#5">5</a>
<a href="#6">6</a>
<a href="#7">7</a>
<a name="1">dfdf</a>
<a name="2">dfdf</a>//
36. Press the two buttons together
if( && ==13)//
37. Refresh the page
javascript:()//
38. Enable the buttons of the web page
<SCRIPT LANGUAGE="JavaScript">
function haha()
{
for(var i=0;i<document.;i++)
{
if(document.[i].("bb")!=-1)
document.[i].disabled=!document.[i].disabled;
}
}
</SCRIPT>
<BODY><form name=form1>
<INPUT TYPE="button" NAME="aa " value=cindy onclick=haha()>
<INPUT TYPE="button" NAME="bb " value=guoguo>
<INPUT TYPE="button" NAME="bb " value=guoguo>
39. Text Movement
<marquee scrollamount=3 onmouseover=(); onmouseout=();>
40. Double-click the web page to run automatically
<SCRIPT LANGUAGE="JavaScript">
var currentpos,timer;
function initialize()
{
timer=setInterval("scrollwindow()",1);
}
function sc()
{
clearInterval(timer);
}
function scrollwindow()
{
currentpos=;
(0,++currentpos);
if (currentpos != )
sc();
}
=sc
=initialize
</SCRIPT>//
41. Back
<INPUT TYPE="button" onclick=() value=back>
42. Move forward
<INPUT TYPE="button" onclick=() value=forward>
43. Refresh
<INPUT TYPE="button" onclick=() value=reload>
44.Turn to the specified web page
="http://ww" or ("")
45. Show real-time time on web pages
<SCRIPT LANGUAGE="JavaScript">
var clock_id;
=function()
{
clock_id=setInterval("document.=(new Date);",1000)
}
</SCRIPT>//
46. Files can be downloaded
="Target File"//
47. Connect to the database
import .*;
String myDBDriver="";
(myDBDriver);
Connection conn=("jdbc:odbc:firm","username","password");
Statement stmt=();
ResultSet rs=(sql);
("column1");//
48. You can write the required content directly in the page "div"
<INPUT TYPE="button" onclick="='<font color=red>*</font>'">
<div id=a1></div>//
49. You can change the format of the connection on the page to make it double-line
<style>
A:link {text-decoration: none; color:#0000FF; font-family: An An}
A: visited {text-decoration: none; color: #0000FF; font-family: An An}
A:hover {text-decoration: underline overline; color: FF0000}
</style>
<style>
A:link {text-decoration: none; color:#0000FF; font-family: An An}
A: visited {text-decoration: none; color: #0000FF; font-family: An An}
A:hover {text-decoration: underline overline line-through; color: FF0000}
TH{FONT-SIZE: 9pt}
TD{FONT-SIZE: 9pt}
body {SCROLLBAR-FACE-COLOR: #A9D46D; SCROLLBAR-HIGHLIGHT-COLOR: #e7e7e7;SCROLLBAR-SHADOW-COLOR:#e7e7e7;
SCROLLBAR-3DLIGHT-COLOR: #000000; LINE-HEIGHT: 15pt; SCROLLBAR-ARROW-COLOR: #ffffff;
SCROLLBAR-TRACK-COLOR: #e7e7e7;}
INPUT{BORDER-TOP-WIDTH: 1px; PADDING-RIGHT: 1px; PADDING-LEFT: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE:
9pt; BORDER-LEFT-COLOR: #cccccc;
BORDER-BOTTOM-WIDTH: 1px; BORDER-BOTTOM-COLOR: #cccccc; PADDING-BOTTOM: 1px; BORDER-TOP-COLOR: #cccccc;
PADDING-TOP: 1px; HEIGHT: 18px; BORDER-RIGHT-WIDTH: 1px; BORDER-RIGHT-COLOR: #cccccc}
DIV,form ,OPTION,P,TD,BR{FONT-FAMILY: install; FONT-SIZE: 9pt}
textarea, select {border-width: 1; border-color: #000000; background-color: #efefef; font-family: An An;
font-size: 9pt; font-style: bold;}
.text { font-family: "Stick"; font-size: 9pt; color: #003300; border: #006600 solid; border-width: 1px 1px
1px 1px}
</style>Complete css
50. Create a new frame
<a
href="javascript:newframe('http:///help/a_little/','http:///help/a_little
/a_13.html')"><img alt=Help border=0 src="http://bjpic./images/mail/"></a>
51. Write content to the file
<%@ page import=".*" %>
<%
String str = "print me";
//always give the path from root. This way it almost always works.
String nameOfTextFile = "/usr/anil/";
try
{
PrintWriter pw = new PrintWriter(new FileOutputStream(nameOfTextFile));
(str);
//clean up
();
}
catch(IOException e)
{
(());
}
%>
52. Read the file first and then write the file
<%@ page language = "java" %>
<%@ page contentType = "text/html; charSet=gb2312" %>
<%@ page import =".*" %>
<%@ page import =".*" %>
<%@ page import =".*" %>
<%@ page import =".*" %>
<%@ page import =".*" %>
<%@ page import=".*" %>
eryrytry
<%
int count=0;
FileInputStream fi =new FileInputStream ("");
ObjectInputStream si= new ObjectInputStream (fi);
count =();
count++;
(count);
();
FileOutputStream fo =new FileOutputStream ("");
ObjectOutputStream so= new ObjectOutputStream (fo);
(count);
();
%>
53. Linear input box
<INPUT name=Password size=10 type=password style="border-left-width: 0; border-right-width: 0;
border-top-width: 0; border-bottom-style: solid; border-bottom-width: 1; background-color: #9CEB9C">
54. You can change the background to button trait and change the attributes by changing the css
<td width="65" align="center" bgcolor="#E0E0E0" onmouseover=='mouseoverbt';
onmouseout=='mouseout';><a href="?classid=76"><font
color="#000000">Recording pen</font></a></td>
<style>
.mouseoverbt
{
background-image: url(/img/);
background-repeat: no-repeat;
}
.mouseout
{
background-color: #E0E0E0;
}
</style>
55. Press CTRL and Q keys at the same time
=function()
{
if(&&==81)
{alert(1)}
}//
56. The following is a complete code to display hint. The idea is that when the mouse stays, the content in the div is displayed on the mouse. When the mouse is moved out, the div is hidden.
Hide it
---------------------------------------------------------------------------------------------------------
------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<style>
#hint{
width:198px;
border:1px solid #000000;
background:#99ff33;
position:absolute;
z-index:9;
padding:6px;
line-height:17px;
text-align:left;
top: 1520px;
}
</style>
<SCRIPT LANGUAGE="JavaScript">
<!--
function showme()
{
var oSon=("hint");
if (oSon==null) return;
with (oSon)
{
innerText=;
="block";
=++6;
=++9;
}
}
function hidme()
{
var oSon=("hint");
if (oSon==null) return;
="none";
}
//-->
</SCRIPT>
<BODY>
<text id=guoguo value=ga>
<a href=# onmouseover=showme() onmouseout=hidme() onmousemove=showme() son=hint>dfdfd</a>
<div id=hint style="display:none"></div>
</BODY>
</HTML>
---------------------------------------------------------------------------------------------------------
------------
57. Popup window
Method 1: <body onload="openwen()"> The pop-up window appears when the browser reads the page;
Method 2: <body onunload="openwen()"> The pop-up window appears when the browser leaves the page;
Method 3: Call with a connection: <a href="#" onclick="openwin()">Open a window</a>
Note: The "#" used is a virtual connection.
Method 4: Call with a button: <input type="button" onclick="openwin()" value="Open Window"> When to load script
58. Dynamically change the size of the font
function doZoom(size)
{
('zoom').=size+'px'
}
function aa()
{
var newWin=(url);
.form1.=value1;
}Change the properties of the domain on the pop-up window
.form2.=value2; Change the value of the domain of the parent window
59.Judge what kind of browser it is
var name = ;
if (name == "Microsoft Internet Explorer")
alert("IE");
else if (name == "Netscape")
alert("NS");//
OK box
<script language="VBScript">
<!--
MsgBox "Are you sure you deleted?", 4
//-->
</script>//
61. Copy content to the clipboard
function JM_cc(bb)
{
var ob=eval("document.form1."+bb);
();
js=();
("Copy");
}//
Create a database connection to retrieve data
public void init()
{
String url="jdbc:odbc:javadata";
try
{
("");
Connection con=(url,"sa","");//mssql database user SA and password
DatabaseMetaData dma=();
("Connect to"+());
(";Driver "+());
(";Version "+());
("");
Statement stmt=();
ResultSet rs=("select * from .TB_NAME where number=1");//Sql
();
String dispresult=("name");
(dispresult);// Instead,you can display it in Paint() or use AWT etc.
();
();
();
}
catch(SQLException ex)
{
("!!!SQL Exception !!!");
while(ex!=null)
{
("SQLState:"+());
("Message:"+());
("Vendor:"+());
ex=();
("");
}
}
catch( ex)
{
();
}
}//
63. Minimize window
()//
64. Document path
//
65. Execute a certain program regularly
setTimeout("change_color()",600);
66. Set as homepage
function makeHome(){
("UniversalPreferencesWrite");
("", );
}//
67. Set as Favorites
function addFav(){
if(ie)
(,' : GROTESQUE MOVIES AND PICTURES');
if(ns)
alert("Thanks for the bookmark!\n\nNetscape users click OK then press CTRL-D");
}//
68. Determine whether cookies are available
;//
69. Display pop-up window with pattern and pages
function setbgcolor_onclick()
{
var color = showModalDialog("/mailpage/compose/",0,"help=0");
if (color != null)
{
= color;
}
}//
70. Intercept the two decimal places
var a=3454545.4454545;
alert((2));//
71. Disable the selection of text on the page to copy
<script>
function noEffect() {
with (event) {
returnValue = false;
cancelBubble = true;
}
return;
}
</script>
<body onselectstart="noEffect()" oncontextmenu="noEffect()">//
72. Block the right-click menu
oncontextmenu=" = false"//
73. Bubble is prohibited in the event
= true//
74. It is prohibited to open the input method in the input box
<input style="ime-mode: disabled">//
75. Block Chinese characters and spaces
<input name="txt"><input type="submit" onClick="alert(!/[^ -}]|\s/.test())">//
76. Use javascript to determine whether the file exists
function Exists(filespec)
{
if (filespec)
{
var fso;
fso = new ActiveXObject("");
alert((filespec));
}
}
Select the picture <input type=file name=f1><p>
<input type="submit" onClick="Exists()">//
77. Get the selected text in the current text box
<input onmouseup="alert(().text)" value=123>//
78. Jump to the target page, and cannot return
<a href="javascript:('/')"></a>//
79. Get the current row is the row of the table
<script>
function getrow(obj)
{
if(=="TD"){
curRow=;
alert("This is the "+(+1)+"line");
}
}
</script>
<table border="1" width="100%" onclick=getrow(this)>
<tr>
<td width="20%"> </td>
<td width="20%"> </td>
<td width="20%"> </td>
<td width="20%"> </td>
<td width="20%"> </td>
</tr>
<tr>
<td width="20%"> </td>
<td width="20%"> </td>
<td width="20%"> </td>
<td width="20%"> </td>
<td width="20%"> </td>
</tr>
</table>//
80. Delete a row in the table, xx represents a row, and the subscript starts from 0.
(xx)//
81. Dynamically add rows to tables
<table border="1">
</table>
<script language="JavaScript">
function add()
{
().insertCell().innerHTML = '<input name="test'++'">';
}//
,,the difference:
x: Set or get the position of the outer boundary of the mouse relative to the parent element of the target event on the x coordinate. clientX: The x-coordinate position relative to the client area, not
Including the scroll bar, it is the text area. offsetx: Set or get the position of the inner boundary of the mouse relative to the parent element of the target event on the x coordinate.
screenX: Relative to the user screen.
83. Which mouse button is displayed
<body onMouseDown="alert()">Click Mouse to see//
84. Open the C drive
<form action="file:///c|/"><input type="submit" value="c:\ drive"></form>//
85. Current screen resolution
、//
86. Set content in the table
[0].cells[1].innerText=.;//
87. Local shortcut keys
<p><a href="file:///::{208D2C60-3AEA-1069-A2D7-08002B30309D}" target="_blank">Online Neighbor</a></p>
<p><a href="file:///::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\d:\web" target="_blank">My computer</a></p>
<p><a href="file:///::{450D8FBA-AD25-11D0-98A8-0800361B1103}" target="_blank">My Document</a></p>
<p><a href="file:///::{645FF040-5081-101B-9F08-00AA002F954E}" target="_blank">Recycle Bin</a></p>
<p><a href="file:///::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"
target="_blank">Control Panel</a></p>
<p><a href="file:///::{7007ACC7-3202-11D1-AAD2-00805FC1270E}">Dial Up Network</a>(Windows 2000)</p>
menu
<button onclick="()"><font face="webdings">0</font></button>//Change the picture on the button
<input type=button onclick="('CreateLink','true','true')"> //Create a new connection
<input type=button onclick="('print','true','true')"> //Print
<input type=button onclick="('saveas','true','website production.htm')">//Save as htm
<input type=button onclick="('saveas','true','website production.txt')">//Save as txt
("SaveAs")//Save as
('undo')//Undo the last operation
Dialog Box
<SCRIPT>
var contents='<style>body,td{font:menu}img{cursor:hand}</style>';
contents+='<title>Do you want to close me</title>';
contents+='<body bgcolor=menu>';
contents+='<table width=100% height=100% border=0>';
contents+='<tr><td align=center>';
contents+='Do you want to close me? <br>';
contents+='<img src= onclick=() alt="...Close">';
contents+='<img src= onclick=() alt="all close">';
contents+='</td></tr></table>';
showModalDialog("about:"+contents+"","","dialogHeight:50px;dialogWidth:250px;help:no;status:no")
(contents);
</SCRIPT>//
90. Take the value of x and y
<button onclick="[x].cells[y].innerText='guoguo'"></button>//
91. Write content to the newly opened web page
newwin=('about:blank','','top=10');
('');//
93. Return
javascript:(-2);//
94. Copy the selected content on the page to the clipboard
abcdefg
<input type='button'
onclick="('text',().text);" value='Copy the page and select it
characters'>//
95. Copy the selected content on the page to the clipboard
<INPUT TYPE="text" NAME="">kjhkjhkhkj<INPUT TYPE="button" onclick="('Copy', 'false',
null);">////
96. When the mouse is moved to the drop-down box, it will automatically open all the time.
<select onmouseover="javascript:=" onmouseout="javascript:=1"></select>//
97. Obtain the file of this machine
var fso = new ActiveXObject("");
var f1 = ("C:\\bsitcdata\\");
alert("File last modified: " + ); //
98. Determine whether the client is an IE browser
Because it is a unique attribute of IE, this method is usually used to determine whether the client is an IE browser,?1:0;
99. Create a new drop-down box option
new Option(text,value) function //
100. Draw a bar chart on the page
<STYLE>
td{font-size:12px}
body{font-size:12px}
v\:*{behavior:url(#default#VML);} //This is declared as a VML public variable
</STYLE>
<SCRIPT LANGUAGE="JavaScript">
mathstr=12;
("<v:rect fillcolor='red'
style='width:20;color:navy;height:"+5000/(1000/mathstr)+"'><br> %"+mathstr+"<br>4 people<v:Extrusion
backdepth='15pt' on='true'/></v:rect>")
</SCRIPT>
<v:rect fillcolor='red' style='width:20;color:navy;height:200'><br>%12<br>4 people<v:Extrusion
backdepth='15pt' on='true'/></v:rect>
<v:rect fillcolor='yellow' style='width:20;color:navy;height:100'><br>%12<br>4 people<v:Extrusion
backdepth='15pt' on='true'/></v:rect>//
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)
{
=;
=10;
="<font size=2 color=red> " + +"</font> <font size=2>" + + "</font>";
}
function hide(pie)
{
="white";
=1;
="";
}
</script>
</head>
<body>
<v:group style='width: 5cm; height: 5cm' coordorigin='0,0' coordsize='250,250'>
<v:shape id='asp technology' style='width:10;height:10;top:10;left:0' title='The number of votes received: 6 Ratio: 40.00%'
onmouseover='javascript:show(this);' onmouseout='javascript:hide(this);' href=''
CoordSize='10,10' strokecolor='white' fillcolor='#ffff33'><v:path v='m 300,200 ae
300,200,200,150,0,9437184 xe'/></v:shape>
<v:shape id='php' style='width:10;height:10;top:10;left:0' title='The number of votes received:1 Ratio:6.67%'
onmouseover='javascript:show(this);' onmouseout='javascript:hide(this);' href=''
CoordSize='10,10' strokecolor='white' fillcolor='#ff9933'><v:path v='m 300,200 ae
300,200,200,150,9437184,1572864 xe'/></v:shape>
<v:shape id='jsp' style='width:10;height:10;top:10;left:0' title='The number of votes received:2 Ratio:13.33%'
onmouseover='javascript:show(this);' onmouseout='javascript:hide(this);' href=''
CoordSize='10,10' strokecolor='white' fillcolor='#3399ff'><v:path v='m 300,200 ae
300,200,200,150,11010048,3145728 xe'/></v:shape>
<v:shape id='c#' .netWEB program written in .netWEB#' style='width:10;height:10;top:10;left:0' title='Number of votes:3 Ratio:20.00%'
onmouseover='javascript:show(this);' onmouseout='javascript:hide(this);' href=''
CoordSize='10,10' strokecolor='white' fillcolor='#99ff33'><v:path v='m 300,200 ae
300,200,200,150,14155776,4718592 xe'/></v:shape>
<v:shape id='Written .netWEB program' style='width:10;height:10;top:10;left:0' title='The number of votes received:2 Ratio:13.33%'
onmouseover='javascript:show(this);' onmouseout='javascript:hide(this);' href=''
CoordSize='10,10' strokecolor='white' fillcolor='#ff6600'><v:path v='m 300,200 ae
300,200,200,150,18874368,3145728 xe'/></v:shape>
<v:shape id='xml technology' style='width:10;height:10;top:10;left:0' title='The number of votes received:1 Ratio:6.67%'
onmouseover='javascript:show(this);' onmouseout='javascript:hide(this);' href=''
CoordSize='10,10' strokecolor='white' fillcolor='#ff99ff'><v:path v='m 300,200 ae
300,200,200,150,22020096,1572864 xe'/></v:shape>
</v:group>
<v:group style='width: 6cm; height: 6cm' coordorigin='0,0' coordsize='250,250'>
<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'> .netWEB program written by c#</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'>
.netWEB program written</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>
<td width="100%" id=div1> </td>
</tr>
</table>
</div>//
102. It is a special container, you can install a web page
<button><iframe src="/"></iframe></button>//button
103. External html code
//
104. Trigger that identifies the current IE event
and//
105. 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=='Overnone' >//
107. Page Flip
<html dir=rtl></html>//
108.Scroll
(x,y);//
<body onload="s=0" onDblClick="s=setInterval('scrollBy(0, 1)',10)" onClick="clearInterval(s)">//
109. Change the status bar
="";//
110. Change the window size
(200,300);//
111. Change the mouse style
style
BODY{CURSOR: url('');
SCROLLBAR-BASE-COLOR: #506AA8;
SCROLLBAR-ARROW-COLOR: #14213F;
}//
112. Transparent background
<input type="button" value="Button" style="background-color: transparent; border: 0;">//
113. The mouse is waiting shape
<input type=button onclick="='wait'">//
114. Call the function of the parent window
opener.fucntion1();//
Internal html code
<input type="button" onclick="alert()" value="View">//
116. Functions that call parent window in the framework
<INPUT TYPE='button' onclick='();' value='Calling function of parent window'>//
117. Switch nodes
<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="(c2)">//
118. Delete nodes
<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="(c2)">//
119. Add a node
addNode()//
120. Obtain the parent and child tags of events
[0] and //
121.Center to change the color for the button
<style>
button{benc:expression( = function(){='#E5F0FF';})}
</style>
<button>New</button>//
122. Determine whether the left button or the right button is pressed
<body onmousedown=if(==1)alert("left key");if(==2)alert("right key")>//
123. Get the name of the operating system and the name of the browser
()//
Press the /ctrl/shift key
//Press the alt key
//Press ctrl key
//Press shift key
125. Position the current position as C disk.
{="c:"}//
126. Return to the type of input box
<script>
alert();//
</script>
127. Simulate the click event of the control
<INPUT TYPE="hidden" name="guoguo" onclick="haha()">
<SCRIPT LANGUAGE="JavaScript">
<!--
function haha()
{
alert();
}
();
//-->
</SCRIPT>//
128. Take out the column name of the record set
rset = ().executeQuery(queryStatement, conn);
metaData = ();
int count = ();
String name = (i);
String value = (i);//
129. Format numbers
function format_number(str,digit)
{
if(isNaN(str))
{
alert("The value you passed in is not a number!");
return 0;
}
else if((digit)!=digit)
{
alert("The decimal places you entered are not integers!");
return 0;
}
else
return (parseFloat(str)*(10,digit))/(10,digit);
}
130. The Enter button is converted into a tab button
if(==13)=9; //Replace
131. Scroll bar
<button onclick="=">Scroll</button><br>
<textarea cols=50 rows=10>
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
</textarea>//
132.Judge what object it is
if(typeof(unknown)=="function")return true;
if(typeof(unknown)!="object")return false;//
133. Cancel the automatic completion function of text box
<input type="text" autocomplete="off"> //
134. Let the drop-down box automatically pull down
<select onmouseover="javascript:=" onmouseout="javascript:=1">
<option value="">1</option>
<option value="">2</option>
<option value="">3</option>
</select> //
135. Read XML file
var childrenobj=myselect//;
var oXMLDoc = new ActiveXObject('MSXML');
= "";
var oRoot=;
if( != null)
{
for(var i=0;i<(0).;++i)
{
oItem = (0).(i);
oOption = new Option(,);
(oOption);
}
}
//document
<?xml version="1.0" encoding="gb2312" ?>
<childrenlist>
<aa>
<child value='3301'>Hangzhou area</child>
<child value='3303'>Wenzhou Region</child>
</aa>
<aa>
<child value='3310'>Taizhou Region</child>
<child value='3311'>Lishui District</child>
</aa>
</childrenlist>//
136. Click on the picture and the picture stops
<a href="javascript:"><img src="http:///images/51js/red_forum.gif" border="0"></a>//
137. Display local computer information
var WshNetwork = new ActiveXObject("");
alert("Domain = " + );
alert("Computer Name = " + );
alert("User Name = " + );//
138. Compare time
tDate = new Date(2004,01,08,14,35); //Year, month, day, hour, minute
dDate = new Date();
tDate<dDate?alert("before"):alert("before");//
139. The link address where the mouse is popped up
<body onmouseover="if (=='A')alert()"><a
href="/?tid=13589" >dddd</a><input>//
140. Note that you cannot test whether a variable exists by comparing it with undefined, although you can check whether its type is "undefined". In
In the following code example, suppose the programmer wants to test whether the variable x has been declared:
// This method does not work
if (x == undefined)
// Do some operations
// This method also does not work- must check
// String “undefined”
if (typeof(x) == undefined)
// Do some operations
// This method works
if (typeof(x) == "undefined")
// Do some operations
141. Create an object with certain attributes
var myObject = new Object();
= "James";
= "22";
= "555 1234";//
142. Enumerate all properties of (loop) objects
for (var a in myObject)
{
// Show "The property 'name' James", etc.
("The property '" + a + "' is " + myObject[a]);
}//
143. Determine whether a number is an integer
var a=23.2;
alert(a%1==1)//
144. Create a new date variable
var a = new Date(2000, 1, 1);
alert(());
145. Define a new method for a class
function trim_1()
{
return (/(^\s*)|(\s*$)/g, "");
}
=trim_1;
alert('cindy'.trim());
146. Define a method to convert date types into strings
function guoguo_date()
{
var tmp1,tmp2;
tmp1 =()+1+"";
if(<2)
tmp1="0"+tmp1;
tmp2 =()+"";
if(<2)
tmp2="0"+tmp2;
return ()+"-"+tmp1+"-"+tmp2;
}
=guoguo_date;
alert(new Date().toLiteString())
147. pasta is a constructor with four parameters that defines objects.
function pasta(grain, width, shape, hasEgg)
{
// What kind of food is it made of?
= grain;
// How wide? (Value)
= width;
// Cross-sectional shape? (String)
= shape;
// Are you adding egg yolks? (boolean)
= hasEgg;
//Define method
=aa;
}
function aa()
{
}
//After defining the object constructor, use the new operator to create the object instance.
var spaghetti = new pasta("wheat", 0.2, "circle", true);
var linguine = new pasta("wheat", 0.3, "oval", true);
//Additional definitions, spaghetti and linguine will automatically obtain new properties
= "carbohydrates";
148. Print out the cause of error
try
{
x = y // An error occurred.
}
catch(e)
{
() //Print "'y' is undefined".
}//
149. Generate Excel file and save
var ExcelSheet;
ExcelApp = new ActiveXObject("");
ExcelSheet = new ActiveXObject("");
//This code starts the application that creates the object (in this case, Microsoft Excel worksheet). Once the object is created, it can be used with the defined pair.
An icon variable refers to it in the code. In the following example, access the properties and methods of the new object and other Excel objects through the object variable ExcelSheet.
Includes Application objects and collections.
// Make Excel visible through the Application object.
= true;
//Place some text into the first box of the table.
(1,1).Value = "This is column A, row 1";
//Save the form.
("C:\\");
// Use the Application object to close Excel using the Quit method.
();//
onBlur: This event is generated when the input focus is lost
onFocus: When the input gets focus, the file is generated
Onchange: This event is generated when the text value changes.
Onselect: When the text is highlighted, the file is generated
<input type="text" value="Guo Qiang" onfocus="if(value=='Guo Qiang') {value=''}" onblur="if
(value=='') {value='Guo Qiang'}">The text disappears when clicking, and the text appears again when the focus is lost.
2. Special color of web buttons
<input type=button name="Submit1" value="Guo Qiang" size=10 class=s02
style="background-color:rgb(235,207,22)">
3. Color changes when the mouse is moved in and out
<input type="submit" value="find it" name="B1" onMouseOut=="blue"
onMouseOver=="red" class="button">
4. Flat buttons
<input type=submit value=subscribe style="border:1px solid :#666666; height:17px; width:25pt; font-size:9pt;
BACKGROUND-COLOR: #E8E8FF; color:#666666" name="submit">
5. Button color change
<input type=text name="nick" style="border:1px solid #666666; font-size:9pt; height:17px;
BACKGROUND-COLOR: #F4F4FF; color:#ff6600" size="15" maxlength="16">
6. Planar input box
<input type="text" name="T1" size="20" style="border-style: solid; border-width: 1">
7. Make the window into the specified size
<script>
(300,283);
</script>
8. Make the text scroll up and down
<marquee direction=up scrollamount=1 scrolldelay=100 onmouseover='()' onmouseout='()'
height=60>
<!-- head_scrolltext -->
<tr>
<td>
Republic
</table> <!-- end head_scrolltext -->
</marquee>
9. The status bar displays the status of the page
<base onmouseover="='Website Construction /' ;return true">
10. You can click on the text to realize the selection of radio options
<br>
<input type="radio" name="regtype" value="A03" >
<label for="A03"> Couples: Register two accounts at a time</label> <br>
11. You can write onclick events in the font in the text field
12. Print</a>Print web page
<a href='javascript: ()'>
13. Linear input box
<input type="text" name="key" size="12" value="keyword" onFocus=() onMouseOver=()
class="line">
14. Display the last modified date of the document
<script language=javascript>
function hi(str)
{
()
alert("hi"+str+"!")
}
</script>
15. Events can be triggered when the mouse is moved to the text
<html>
<head>
<script language="LiveScript">
<!-- Hiding
function hello() {
alert("Harrow!");
}
</script>
</head>
<body>
<a href="" onMouseOver="hello()">link</a>
</body>
</html>
16. The page color can be determined based on the options on the web page
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<SCRIPT>
<!--
function bgChange(selObj) {
newColor = [].text;
= newColor;
= -1;
}
//-->
</SCRIPT>
<BODY STYLE="font-family:Arial">
<B>Changing Background Colors</B>
<BR>
<FORM>
<SELECT SIZE="8" onChange="bgChange(this);">
<OPTION>Red
<OPTION>Orange
<OPTION>Yellow
<OPTION>Green
<OPTION>Blue
<OPTION>Indigo
<OPTION>Violet
<OPTION>White
<OPTION>pink
</SELECT>
</FORM>
</BODY>
</HTML>
17. Change the button's characteristics
<style type="text/CSS">
<!--
.style1 { font-size: 12px; background: #CCCCFF; border-width: thin thin thin thin; border-color: #CCCCFF
#CCCCCC #CCCCCC #CCCCFF}
.style2 { font-size: 12px; font-weight: bold; background: #CCFFCC; border-width: thin medium medium thin;
border-color: #CCFF99 #999999 #999999 #CCFF99}
-->
</style>
The code of this button is as follows:
<input type="submit" name="Submit" value="Submit" onmouseover="='style2'"
onmouseout="='style1'" class="style1">
18. Change the picture of the button.
<style type="text/css">
<!--
.style3 { font-size: 12px; background: url(image/); border: 0px; width: 60px; height: 22px}
.style4 { font-size: 12px; font-weight: bold; background: url(image/); border: 0px 0; width:
60px; height: 22px}
-->
</style>
The button code of this example is as follows:
<input type="submit" name="Submit2" value="Submit" onmouseover="='style4'"
onmouseout="='style3'" class="style3">
19. Print the page
<div align="center"><a class=content href="javascript:doPrint();">Print this manuscript</a></div>
20. You can write html language directly
("");
21. Change the color of the drop-down box
<select name="classid"
onChange="changelocation([].value)"
size="1" style="color:#008080;font-size: 9pt">
22. Go to the target URL
="http://guoguo"
23. Pass the form of the object
UpdateSN('guoqiang99267',)
function UpdateSN(strValue,strForm)
{
= strValue;
return false;
}
24. Text tags
<label for="AltName4"><input name="AltName" type="RADIO" tabindex="931"
>guoqiang99859</label>
25.layer2 is the component's ID, which can control whether the component is visible
('Layer2'). = "block";
('Layer2'). = "none";//
26. Add the page to favorite
<script language=javascript>
<!--
function Addme(){
url = """; //Your own homepage address
title = "Your Site Name"; //Your own homepage name
(url,title);
-->
</script>//
27. The page will be closed automatically after 10 seconds
< script language="JavaScript" >
function closeit() {
setTimeout("()",10000)
}
< /script >
28.Can compare the size of characters
char=(i);
if(!('0'<=char&&char<='9'))
29. Convert characters to numbers
month = parseInt(char)
30. When clicking the value non-empty option, turn to the specified connection
<select onchange='if(!="")()' class="textinput">
<option selected>sponsor</option>
<option>-----------------</option>
<option value="/">Beijing Daily</option>
<option value="/">Beijing Evening News</option>
</select>
31. Change the background color
<td width=* class=dp bgColor=#FAFBFC onmouseover="='#FFFFFF';"
onmouseout="='#FAFBFC';">
32. Change the background color of the text input box
<style>
.input2 {background-image: url('../images/'); font-size: 12px; background-color:
#D0DABB;border-top-width:1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px}
</style>
<input name=content type=text size="47" class="input2" maxlength="50">
33. Change the characteristics of horizontal lines
<hr size="0" noshade color="#C0C0C0">
34. The way to pass parameters
<a href="?CurPage=8&id=3488">8</a>
35. Jump within the page
<a href="#1">1</a>
<a href="#2">2</a>
<a href="#3">3</a>
<a href="#4">4</a>
<a href="#5">5</a>
<a href="#6">6</a>
<a href="#7">7</a>
<a name="1">dfdf</a>
<a name="2">dfdf</a>//
36. Press the two buttons together
if( && ==13)//
37. Refresh the page
javascript:()//
38. Enable the buttons of the web page
<SCRIPT LANGUAGE="JavaScript">
function haha()
{
for(var i=0;i<document.;i++)
{
if(document.[i].("bb")!=-1)
document.[i].disabled=!document.[i].disabled;
}
}
</SCRIPT>
<BODY><form name=form1>
<INPUT TYPE="button" NAME="aa " value=cindy onclick=haha()>
<INPUT TYPE="button" NAME="bb " value=guoguo>
<INPUT TYPE="button" NAME="bb " value=guoguo>
39. Text Movement
<marquee scrollamount=3 onmouseover=(); onmouseout=();>
40. Double-click the web page to run automatically
<SCRIPT LANGUAGE="JavaScript">
var currentpos,timer;
function initialize()
{
timer=setInterval("scrollwindow()",1);
}
function sc()
{
clearInterval(timer);
}
function scrollwindow()
{
currentpos=;
(0,++currentpos);
if (currentpos != )
sc();
}
=sc
=initialize
</SCRIPT>//
41. Back
<INPUT TYPE="button" onclick=() value=back>
42. Move forward
<INPUT TYPE="button" onclick=() value=forward>
43. Refresh
<INPUT TYPE="button" onclick=() value=reload>
44.Turn to the specified web page
="http://ww" or ("")
45. Show real-time time on web pages
<SCRIPT LANGUAGE="JavaScript">
var clock_id;
=function()
{
clock_id=setInterval("document.=(new Date);",1000)
}
</SCRIPT>//
46. Files can be downloaded
="Target File"//
47. Connect to the database
import .*;
String myDBDriver="";
(myDBDriver);
Connection conn=("jdbc:odbc:firm","username","password");
Statement stmt=();
ResultSet rs=(sql);
("column1");//
48. You can write the required content directly in the page "div"
<INPUT TYPE="button" onclick="='<font color=red>*</font>'">
<div id=a1></div>//
49. You can change the format of the connection on the page to make it double-line
<style>
A:link {text-decoration: none; color:#0000FF; font-family: An An}
A: visited {text-decoration: none; color: #0000FF; font-family: An An}
A:hover {text-decoration: underline overline; color: FF0000}
</style>
<style>
A:link {text-decoration: none; color:#0000FF; font-family: An An}
A: visited {text-decoration: none; color: #0000FF; font-family: An An}
A:hover {text-decoration: underline overline line-through; color: FF0000}
TH{FONT-SIZE: 9pt}
TD{FONT-SIZE: 9pt}
body {SCROLLBAR-FACE-COLOR: #A9D46D; SCROLLBAR-HIGHLIGHT-COLOR: #e7e7e7;SCROLLBAR-SHADOW-COLOR:#e7e7e7;
SCROLLBAR-3DLIGHT-COLOR: #000000; LINE-HEIGHT: 15pt; SCROLLBAR-ARROW-COLOR: #ffffff;
SCROLLBAR-TRACK-COLOR: #e7e7e7;}
INPUT{BORDER-TOP-WIDTH: 1px; PADDING-RIGHT: 1px; PADDING-LEFT: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE:
9pt; BORDER-LEFT-COLOR: #cccccc;
BORDER-BOTTOM-WIDTH: 1px; BORDER-BOTTOM-COLOR: #cccccc; PADDING-BOTTOM: 1px; BORDER-TOP-COLOR: #cccccc;
PADDING-TOP: 1px; HEIGHT: 18px; BORDER-RIGHT-WIDTH: 1px; BORDER-RIGHT-COLOR: #cccccc}
DIV,form ,OPTION,P,TD,BR{FONT-FAMILY: install; FONT-SIZE: 9pt}
textarea, select {border-width: 1; border-color: #000000; background-color: #efefef; font-family: An An;
font-size: 9pt; font-style: bold;}
.text { font-family: "Stick"; font-size: 9pt; color: #003300; border: #006600 solid; border-width: 1px 1px
1px 1px}
</style>Complete css
50. Create a new frame
<a
href="javascript:newframe('http:///help/a_little/','http:///help/a_little
/a_13.html')"><img alt=Help border=0 src="http://bjpic./images/mail/"></a>
51. Write content to the file
<%@ page import=".*" %>
<%
String str = "print me";
//always give the path from root. This way it almost always works.
String nameOfTextFile = "/usr/anil/";
try
{
PrintWriter pw = new PrintWriter(new FileOutputStream(nameOfTextFile));
(str);
//clean up
();
}
catch(IOException e)
{
(());
}
%>
52. Read the file first and then write the file
<%@ page language = "java" %>
<%@ page contentType = "text/html; charSet=gb2312" %>
<%@ page import =".*" %>
<%@ page import =".*" %>
<%@ page import =".*" %>
<%@ page import =".*" %>
<%@ page import =".*" %>
<%@ page import=".*" %>
eryrytry
<%
int count=0;
FileInputStream fi =new FileInputStream ("");
ObjectInputStream si= new ObjectInputStream (fi);
count =();
count++;
(count);
();
FileOutputStream fo =new FileOutputStream ("");
ObjectOutputStream so= new ObjectOutputStream (fo);
(count);
();
%>
53. Linear input box
<INPUT name=Password size=10 type=password style="border-left-width: 0; border-right-width: 0;
border-top-width: 0; border-bottom-style: solid; border-bottom-width: 1; background-color: #9CEB9C">
54. You can change the background to button trait and change the attributes by changing the css
<td width="65" align="center" bgcolor="#E0E0E0" onmouseover=='mouseoverbt';
onmouseout=='mouseout';><a href="?classid=76"><font
color="#000000">Recording pen</font></a></td>
<style>
.mouseoverbt
{
background-image: url(/img/);
background-repeat: no-repeat;
}
.mouseout
{
background-color: #E0E0E0;
}
</style>
55. Press CTRL and Q keys at the same time
=function()
{
if(&&==81)
{alert(1)}
}//
56. The following is a complete code to display hint. The idea is that when the mouse stays, the content in the div is displayed on the mouse. When the mouse is moved out, the div is hidden.
Hide it
---------------------------------------------------------------------------------------------------------
------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<style>
#hint{
width:198px;
border:1px solid #000000;
background:#99ff33;
position:absolute;
z-index:9;
padding:6px;
line-height:17px;
text-align:left;
top: 1520px;
}
</style>
<SCRIPT LANGUAGE="JavaScript">
<!--
function showme()
{
var oSon=("hint");
if (oSon==null) return;
with (oSon)
{
innerText=;
="block";
=++6;
=++9;
}
}
function hidme()
{
var oSon=("hint");
if (oSon==null) return;
="none";
}
//-->
</SCRIPT>
<BODY>
<text id=guoguo value=ga>
<a href=# onmouseover=showme() onmouseout=hidme() onmousemove=showme() son=hint>dfdfd</a>
<div id=hint style="display:none"></div>
</BODY>
</HTML>
---------------------------------------------------------------------------------------------------------
------------
57. Popup window
Method 1: <body onload="openwen()"> The pop-up window appears when the browser reads the page;
Method 2: <body onunload="openwen()"> The pop-up window appears when the browser leaves the page;
Method 3: Call with a connection: <a href="#" onclick="openwin()">Open a window</a>
Note: The "#" used is a virtual connection.
Method 4: Call with a button: <input type="button" onclick="openwin()" value="Open Window"> When to load script
58. Dynamically change the size of the font
function doZoom(size)
{
('zoom').=size+'px'
}
function aa()
{
var newWin=(url);
.form1.=value1;
}Change the properties of the domain on the pop-up window
.form2.=value2; Change the value of the domain of the parent window
59.Judge what kind of browser it is
var name = ;
if (name == "Microsoft Internet Explorer")
alert("IE");
else if (name == "Netscape")
alert("NS");//
OK box
<script language="VBScript">
<!--
MsgBox "Are you sure you deleted?", 4
//-->
</script>//
61. Copy content to the clipboard
function JM_cc(bb)
{
var ob=eval("document.form1."+bb);
();
js=();
("Copy");
}//
Create a database connection to retrieve data
public void init()
{
String url="jdbc:odbc:javadata";
try
{
("");
Connection con=(url,"sa","");//mssql database user SA and password
DatabaseMetaData dma=();
("Connect to"+());
(";Driver "+());
(";Version "+());
("");
Statement stmt=();
ResultSet rs=("select * from .TB_NAME where number=1");//Sql
();
String dispresult=("name");
(dispresult);// Instead,you can display it in Paint() or use AWT etc.
();
();
();
}
catch(SQLException ex)
{
("!!!SQL Exception !!!");
while(ex!=null)
{
("SQLState:"+());
("Message:"+());
("Vendor:"+());
ex=();
("");
}
}
catch( ex)
{
();
}
}//
63. Minimize window
()//
64. Document path
//
65. Execute a certain program regularly
setTimeout("change_color()",600);
66. Set as homepage
function makeHome(){
("UniversalPreferencesWrite");
("", );
}//
67. Set as Favorites
function addFav(){
if(ie)
(,' : GROTESQUE MOVIES AND PICTURES');
if(ns)
alert("Thanks for the bookmark!\n\nNetscape users click OK then press CTRL-D");
}//
68. Determine whether cookies are available
;//
69. Display pop-up window with pattern and pages
function setbgcolor_onclick()
{
var color = showModalDialog("/mailpage/compose/",0,"help=0");
if (color != null)
{
= color;
}
}//
70. Intercept the two decimal places
var a=3454545.4454545;
alert((2));//
71. Disable the selection of text on the page to copy
<script>
function noEffect() {
with (event) {
returnValue = false;
cancelBubble = true;
}
return;
}
</script>
<body onselectstart="noEffect()" oncontextmenu="noEffect()">//
72. Block the right-click menu
oncontextmenu=" = false"//
73. Bubble is prohibited in the event
= true//
74. It is prohibited to open the input method in the input box
<input style="ime-mode: disabled">//
75. Block Chinese characters and spaces
<input name="txt"><input type="submit" onClick="alert(!/[^ -}]|\s/.test())">//
76. Use javascript to determine whether the file exists
function Exists(filespec)
{
if (filespec)
{
var fso;
fso = new ActiveXObject("");
alert((filespec));
}
}
Select the picture <input type=file name=f1><p>
<input type="submit" onClick="Exists()">//
77. Get the selected text in the current text box
<input onmouseup="alert(().text)" value=123>//
78. Jump to the target page, and cannot return
<a href="javascript:('/')"></a>//
79. Get the current row is the row of the table
<script>
function getrow(obj)
{
if(=="TD"){
curRow=;
alert("This is the "+(+1)+"line");
}
}
</script>
<table border="1" width="100%" onclick=getrow(this)>
<tr>
<td width="20%"> </td>
<td width="20%"> </td>
<td width="20%"> </td>
<td width="20%"> </td>
<td width="20%"> </td>
</tr>
<tr>
<td width="20%"> </td>
<td width="20%"> </td>
<td width="20%"> </td>
<td width="20%"> </td>
<td width="20%"> </td>
</tr>
</table>//
80. Delete a row in the table, xx represents a row, and the subscript starts from 0.
(xx)//
81. Dynamically add rows to tables
<table border="1">
</table>
<script language="JavaScript">
function add()
{
().insertCell().innerHTML = '<input name="test'++'">';
}//
,,the difference:
x: Set or get the position of the outer boundary of the mouse relative to the parent element of the target event on the x coordinate. clientX: The x-coordinate position relative to the client area, not
Including the scroll bar, it is the text area. offsetx: Set or get the position of the inner boundary of the mouse relative to the parent element of the target event on the x coordinate.
screenX: Relative to the user screen.
83. Which mouse button is displayed
<body onMouseDown="alert()">Click Mouse to see//
84. Open the C drive
<form action="file:///c|/"><input type="submit" value="c:\ drive"></form>//
85. Current screen resolution
、//
86. Set content in the table
[0].cells[1].innerText=.;//
87. Local shortcut keys
<p><a href="file:///::{208D2C60-3AEA-1069-A2D7-08002B30309D}" target="_blank">Online Neighbor</a></p>
<p><a href="file:///::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\d:\web" target="_blank">My computer</a></p>
<p><a href="file:///::{450D8FBA-AD25-11D0-98A8-0800361B1103}" target="_blank">My Document</a></p>
<p><a href="file:///::{645FF040-5081-101B-9F08-00AA002F954E}" target="_blank">Recycle Bin</a></p>
<p><a href="file:///::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"
target="_blank">Control Panel</a></p>
<p><a href="file:///::{7007ACC7-3202-11D1-AAD2-00805FC1270E}">Dial Up Network</a>(Windows 2000)</p>
menu
<button onclick="()"><font face="webdings">0</font></button>//Change the picture on the button
<input type=button onclick="('CreateLink','true','true')"> //Create a new connection
<input type=button onclick="('print','true','true')"> //Print
<input type=button onclick="('saveas','true','website production.htm')">//Save as htm
<input type=button onclick="('saveas','true','website production.txt')">//Save as txt
("SaveAs")//Save as
('undo')//Undo the last operation
Dialog Box
<SCRIPT>
var contents='<style>body,td{font:menu}img{cursor:hand}</style>';
contents+='<title>Do you want to close me</title>';
contents+='<body bgcolor=menu>';
contents+='<table width=100% height=100% border=0>';
contents+='<tr><td align=center>';
contents+='Do you want to close me? <br>';
contents+='<img src= onclick=() alt="...Close">';
contents+='<img src= onclick=() alt="all close">';
contents+='</td></tr></table>';
showModalDialog("about:"+contents+"","","dialogHeight:50px;dialogWidth:250px;help:no;status:no")
(contents);
</SCRIPT>//
90. Take the value of x and y
<button onclick="[x].cells[y].innerText='guoguo'"></button>//
91. Write content to the newly opened web page
newwin=('about:blank','','top=10');
('');//
93. Return
javascript:(-2);//
94. Copy the selected content on the page to the clipboard
abcdefg
<input type='button'
onclick="('text',().text);" value='Copy the page and select it
characters'>//
95. Copy the selected content on the page to the clipboard
<INPUT TYPE="text" NAME="">kjhkjhkhkj<INPUT TYPE="button" onclick="('Copy', 'false',
null);">////
96. When the mouse is moved to the drop-down box, it will automatically open all the time.
<select onmouseover="javascript:=" onmouseout="javascript:=1"></select>//
97. Obtain the file of this machine
var fso = new ActiveXObject("");
var f1 = ("C:\\bsitcdata\\");
alert("File last modified: " + ); //
98. Determine whether the client is an IE browser
Because it is a unique attribute of IE, this method is usually used to determine whether the client is an IE browser,?1:0;
99. Create a new drop-down box option
new Option(text,value) function //
100. Draw a bar chart on the page
<STYLE>
td{font-size:12px}
body{font-size:12px}
v\:*{behavior:url(#default#VML);} //This is declared as a VML public variable
</STYLE>
<SCRIPT LANGUAGE="JavaScript">
mathstr=12;
("<v:rect fillcolor='red'
style='width:20;color:navy;height:"+5000/(1000/mathstr)+"'><br> %"+mathstr+"<br>4 people<v:Extrusion
backdepth='15pt' on='true'/></v:rect>")
</SCRIPT>
<v:rect fillcolor='red' style='width:20;color:navy;height:200'><br>%12<br>4 people<v:Extrusion
backdepth='15pt' on='true'/></v:rect>
<v:rect fillcolor='yellow' style='width:20;color:navy;height:100'><br>%12<br>4 people<v:Extrusion
backdepth='15pt' on='true'/></v:rect>//
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)
{
=;
=10;
="<font size=2 color=red> " + +"</font> <font size=2>" + + "</font>";
}
function hide(pie)
{
="white";
=1;
="";
}
</script>
</head>
<body>
<v:group style='width: 5cm; height: 5cm' coordorigin='0,0' coordsize='250,250'>
<v:shape id='asp technology' style='width:10;height:10;top:10;left:0' title='The number of votes received: 6 Ratio: 40.00%'
onmouseover='javascript:show(this);' onmouseout='javascript:hide(this);' href=''
CoordSize='10,10' strokecolor='white' fillcolor='#ffff33'><v:path v='m 300,200 ae
300,200,200,150,0,9437184 xe'/></v:shape>
<v:shape id='php' style='width:10;height:10;top:10;left:0' title='The number of votes received:1 Ratio:6.67%'
onmouseover='javascript:show(this);' onmouseout='javascript:hide(this);' href=''
CoordSize='10,10' strokecolor='white' fillcolor='#ff9933'><v:path v='m 300,200 ae
300,200,200,150,9437184,1572864 xe'/></v:shape>
<v:shape id='jsp' style='width:10;height:10;top:10;left:0' title='The number of votes received:2 Ratio:13.33%'
onmouseover='javascript:show(this);' onmouseout='javascript:hide(this);' href=''
CoordSize='10,10' strokecolor='white' fillcolor='#3399ff'><v:path v='m 300,200 ae
300,200,200,150,11010048,3145728 xe'/></v:shape>
<v:shape id='c#' .netWEB program written in .netWEB#' style='width:10;height:10;top:10;left:0' title='Number of votes:3 Ratio:20.00%'
onmouseover='javascript:show(this);' onmouseout='javascript:hide(this);' href=''
CoordSize='10,10' strokecolor='white' fillcolor='#99ff33'><v:path v='m 300,200 ae
300,200,200,150,14155776,4718592 xe'/></v:shape>
<v:shape id='Written .netWEB program' style='width:10;height:10;top:10;left:0' title='The number of votes received:2 Ratio:13.33%'
onmouseover='javascript:show(this);' onmouseout='javascript:hide(this);' href=''
CoordSize='10,10' strokecolor='white' fillcolor='#ff6600'><v:path v='m 300,200 ae
300,200,200,150,18874368,3145728 xe'/></v:shape>
<v:shape id='xml technology' style='width:10;height:10;top:10;left:0' title='The number of votes received:1 Ratio:6.67%'
onmouseover='javascript:show(this);' onmouseout='javascript:hide(this);' href=''
CoordSize='10,10' strokecolor='white' fillcolor='#ff99ff'><v:path v='m 300,200 ae
300,200,200,150,22020096,1572864 xe'/></v:shape>
</v:group>
<v:group style='width: 6cm; height: 6cm' coordorigin='0,0' coordsize='250,250'>
<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'> .netWEB program written by c#</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'>
.netWEB program written</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>
<td width="100%" id=div1> </td>
</tr>
</table>
</div>//
102. It is a special container, you can install a web page
<button><iframe src="/"></iframe></button>//button
103. External html code
//
104. Trigger that identifies the current IE event
and//
105. 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=='Overnone' >//
107. Page Flip
<html dir=rtl></html>//
108.Scroll
(x,y);//
<body onload="s=0" onDblClick="s=setInterval('scrollBy(0, 1)',10)" onClick="clearInterval(s)">//
109. Change the status bar
="";//
110. Change the window size
(200,300);//
111. Change the mouse style
style
BODY{CURSOR: url('');
SCROLLBAR-BASE-COLOR: #506AA8;
SCROLLBAR-ARROW-COLOR: #14213F;
}//
112. Transparent background
<input type="button" value="Button" style="background-color: transparent; border: 0;">//
113. The mouse is waiting shape
<input type=button onclick="='wait'">//
114. Call the function of the parent window
opener.fucntion1();//
Internal html code
<input type="button" onclick="alert()" value="View">//
116. Functions that call parent window in the framework
<INPUT TYPE='button' onclick='();' value='Calling function of parent window'>//
117. Switch nodes
<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="(c2)">//
118. Delete nodes
<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="(c2)">//
119. Add a node
addNode()//
120. Obtain the parent and child tags of events
[0] and //
121.Center to change the color for the button
<style>
button{benc:expression( = function(){='#E5F0FF';})}
</style>
<button>New</button>//
122. Determine whether the left button or the right button is pressed
<body onmousedown=if(==1)alert("left key");if(==2)alert("right key")>//
123. Get the name of the operating system and the name of the browser
()//
Press the /ctrl/shift key
//Press the alt key
//Press ctrl key
//Press shift key
125. Position the current position as C disk.
{="c:"}//
126. Return to the type of input box
<script>
alert();//
</script>
127. Simulate the click event of the control
<INPUT TYPE="hidden" name="guoguo" onclick="haha()">
<SCRIPT LANGUAGE="JavaScript">
<!--
function haha()
{
alert();
}
();
//-->
</SCRIPT>//
128. Take out the column name of the record set
rset = ().executeQuery(queryStatement, conn);
metaData = ();
int count = ();
String name = (i);
String value = (i);//
129. Format numbers
function format_number(str,digit)
{
if(isNaN(str))
{
alert("The value you passed in is not a number!");
return 0;
}
else if((digit)!=digit)
{
alert("The decimal places you entered are not integers!");
return 0;
}
else
return (parseFloat(str)*(10,digit))/(10,digit);
}
130. The Enter button is converted into a tab button
if(==13)=9; //Replace
131. Scroll bar
<button onclick="=">Scroll</button><br>
<textarea cols=50 rows=10>
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
</textarea>//
132.Judge what object it is
if(typeof(unknown)=="function")return true;
if(typeof(unknown)!="object")return false;//
133. Cancel the automatic completion function of text box
<input type="text" autocomplete="off"> //
134. Let the drop-down box automatically pull down
<select onmouseover="javascript:=" onmouseout="javascript:=1">
<option value="">1</option>
<option value="">2</option>
<option value="">3</option>
</select> //
135. Read XML file
var childrenobj=myselect//;
var oXMLDoc = new ActiveXObject('MSXML');
= "";
var oRoot=;
if( != null)
{
for(var i=0;i<(0).;++i)
{
oItem = (0).(i);
oOption = new Option(,);
(oOption);
}
}
//document
<?xml version="1.0" encoding="gb2312" ?>
<childrenlist>
<aa>
<child value='3301'>Hangzhou area</child>
<child value='3303'>Wenzhou Region</child>
</aa>
<aa>
<child value='3310'>Taizhou Region</child>
<child value='3311'>Lishui District</child>
</aa>
</childrenlist>//
136. Click on the picture and the picture stops
<a href="javascript:"><img src="http:///images/51js/red_forum.gif" border="0"></a>//
137. Display local computer information
var WshNetwork = new ActiveXObject("");
alert("Domain = " + );
alert("Computer Name = " + );
alert("User Name = " + );//
138. Compare time
tDate = new Date(2004,01,08,14,35); //Year, month, day, hour, minute
dDate = new Date();
tDate<dDate?alert("before"):alert("before");//
139. The link address where the mouse is popped up
<body onmouseover="if (=='A')alert()"><a
href="/?tid=13589" >dddd</a><input>//
140. Note that you cannot test whether a variable exists by comparing it with undefined, although you can check whether its type is "undefined". In
In the following code example, suppose the programmer wants to test whether the variable x has been declared:
// This method does not work
if (x == undefined)
// Do some operations
// This method also does not work- must check
// String “undefined”
if (typeof(x) == undefined)
// Do some operations
// This method works
if (typeof(x) == "undefined")
// Do some operations
141. Create an object with certain attributes
var myObject = new Object();
= "James";
= "22";
= "555 1234";//
142. Enumerate all properties of (loop) objects
for (var a in myObject)
{
// Show "The property 'name' James", etc.
("The property '" + a + "' is " + myObject[a]);
}//
143. Determine whether a number is an integer
var a=23.2;
alert(a%1==1)//
144. Create a new date variable
var a = new Date(2000, 1, 1);
alert(());
145. Define a new method for a class
function trim_1()
{
return (/(^\s*)|(\s*$)/g, "");
}
=trim_1;
alert('cindy'.trim());
146. Define a method to convert date types into strings
function guoguo_date()
{
var tmp1,tmp2;
tmp1 =()+1+"";
if(<2)
tmp1="0"+tmp1;
tmp2 =()+"";
if(<2)
tmp2="0"+tmp2;
return ()+"-"+tmp1+"-"+tmp2;
}
=guoguo_date;
alert(new Date().toLiteString())
147. pasta is a constructor with four parameters that defines objects.
function pasta(grain, width, shape, hasEgg)
{
// What kind of food is it made of?
= grain;
// How wide? (Value)
= width;
// Cross-sectional shape? (String)
= shape;
// Are you adding egg yolks? (boolean)
= hasEgg;
//Define method
=aa;
}
function aa()
{
}
//After defining the object constructor, use the new operator to create the object instance.
var spaghetti = new pasta("wheat", 0.2, "circle", true);
var linguine = new pasta("wheat", 0.3, "oval", true);
//Additional definitions, spaghetti and linguine will automatically obtain new properties
= "carbohydrates";
148. Print out the cause of error
try
{
x = y // An error occurred.
}
catch(e)
{
() //Print "'y' is undefined".
}//
149. Generate Excel file and save
var ExcelSheet;
ExcelApp = new ActiveXObject("");
ExcelSheet = new ActiveXObject("");
//This code starts the application that creates the object (in this case, Microsoft Excel worksheet). Once the object is created, it can be used with the defined pair.
An icon variable refers to it in the code. In the following example, access the properties and methods of the new object and other Excel objects through the object variable ExcelSheet.
Includes Application objects and collections.
// Make Excel visible through the Application object.
= true;
//Place some text into the first box of the table.
(1,1).Value = "This is column A, row 1";
//Save the form.
("C:\\");
// Use the Application object to close Excel using the Quit method.
();//
12Next pageRead the full text