33. Which Radio was selected
<HTML> <script language="vbscript"> function checkme() for each ob in radio1 if ob.checked then window.alert ob.value next end function </script> <BODY> <INPUT name="radio1" type="radio" value="/style" checked>Style <INPUT name="radio1" type="radio" value="/blog/barcode">Barcode <INPUT type="button" value="check" onclick="checkme()"> </BODY> </HTML> |
34. The script never makes any errors
<SCRIPT LANGUAGE="JavaScript"> <!-- Hide function killErrors() { return true; } window.onerror = killErrors; // --> </SCRIPT> |
35.ENTER key allows the cursor to move to the next input box
<input onkeydown="if(event.keyCode==13)event.keyCode=9"> |
36. Detect the link speed of a certain website:
Add the following code to the <body> area:
<script language=Javascript> |
37. Various styles of cursors
auto: standard cursor default: standard arrow hand: hand cursor wait : Wait for the cursor text: I-shaped cursor vertical-text: horizontal I-shaped cursor no-drop: The cursor cannot be dragged not-allowed: Invalid cursor help :?Help cursor all-scroll: triangle direction mark move: mobile tag crosshair: crosshair e-resize n-resize nw-resize w-resize s-resize se-resize sw-resize |
38. Special effects for page entry and exit
Go to the page
<meta http-equiv="Page-Enter" content="revealTrans(duration=x, transition=y)"> |
Exit page
<meta http-equiv="Page-Exit" content="revealTrans(duration=x, transition=y)"> |
This is some special effects when the page is loaded and called out. duration represents the duration of the special effect in seconds. The transition indicates which special effect is used, with the value 1-23:
0 Rectangle shrink 1 Rectangle expand 2 Round shrink 3 Round expand 4 Down to top 5 Up to bottom 6 Refresh left to right 7 Refresh right to left 8 Vertical blinds 9 Horizontal blinds 10 Displaced horizontal blinds 11 Displaced vertical blinds 12 dots Diffusion 13 left to middle refresh 14 middle to left to right refresh 15 middle to top down 16 upper down to middle 17 lower right to top left 18 upper right to bottom left 19 upper left to bottom right 20 lower left to top right 21 horizontal bar 22 vertical bar 23 above 22 random selection kind |
39. Jump within the specified time
<META http-equiv=V="REFRESH" content="5;URL=http://www.chinaz.com"> |
40. Whether the web page is retrieved
<meta name="ROBOTS" content="attribute value"> The attribute values are as follows: The attribute value is "all": The file will be retrieved, and the links on the page can be queried; The property value is "none": The file is not retrieved and the links on the page are not queryed; The property value is "index": the file will be retrieved; The property value is "follow": the link on the query page; The attribute value is "noindex": The file is not retrieved, but can be queryed for links; The property value is "nofollow": The file is not retrieved, but the links on the page can be queried. |
41. Email address division
Add the following code to the <body> area
<a href="mailto:[email protected]">[email protected] </a> |
42. Table of flowing border effects
Add the following code to the <body> area
<SCRIPT> l=Array(6,7,8,9,'a','b','b','c','d','e','f') Nx=5;Ny=35 t=" <table border=0 cellpacing=0 cellpadding=0 height="+((Nx+2)*16)+"> <tr>" for(x=Nx;x <Nx+Ny;x++) t+=" <td width=16 id=a_mo"+x+"> </td>" t+=" </tr> <tr> <td width=10 id=a_mo"+(Nx-1)+"> </td> <td colspan="+(Ny-2)+" rowspan="+( Nx)+"> </td> <td width=16 id=a_mo"+(Nx+Ny)+"> </td> </tr>" for(x=2;x <=Nx;x++) t+=" <tr> <td width=16 id=a_mo"+(Nx-x)+"> </td> <td width=16 id=a_mo"+(Ny+Nx+x-1)+"> </td> </tr>" t+=" <tr>" for(x=Ny;x>0;x--) t+=" <td width=16 id=a_mo"+(x+Nx*2+Ny-1)+"> </td>" ***(t+" </tr> </table>") var N=Nx*2+Ny*2 function f1(y){ for(i=0;i <N;i++){ c=(i+y)%20; if(c>10)c=20-c document.all["a_mo"+(i)].bgColor="""#0000"+l[c]+l[c]+"'"} y++ setTimeout('f1('+y+')','1')} f1(1) </SCRIPT> |
43. JavaScript home page pop-up skills
Pop up in the middle of the window
<script> window.open("http://www.chinaz.com","","width=400,height=240,top="+(screen.availHeight-240)/2+",left="+(screen .availWidth-400)/2); </script> =============== <html> <head> <script language="LiveScript"> function WinOpen() { msg=open("","DisplayWindow","toolbar=no,directories=no,menubar=no"); msg.***(" <HEAD> <TITLE>Harrow! </TITLE> </HEAD>"); msg.***(" <CENTER> <H1>It's so cool! </H1> <h2> This is the window opened by <B>JavaScript </B>! </h2> </CENTER>"); } </script> </head> <body> <form> <input type="button" name="Button1" value="Push me" onclick="WinOpen()"> </form> </body> </html> |
1. In the following code, you just click to open a window to link to the Chinese webmaster website. And when you want to close, just click to close the window that just opened.
The code is as follows:
<SCRIPT language="JavaScript"> <! -- function openclk() { another=open('1000){this.resized=true;this.style.width=1000;}" align=absMiddle border=0>http://www.chinaz.com', 'NewWindow'); } function closeclk() { another.close(); } //--> </SCRIPT> <FORM> <INPUT TYPE="BUTTON" NAME="open" value="/Open a window" onClick="openclk()"> <BR> <INPUT TYPE="BUTTON" NAME="close" value="/blog/Close this window" onClick="closeclk()"> </FORM> |
2. The above code is too quiet, why not feel a little dynamic? How great would it be if I could give the page a landing effect!
The code is as follows:
<script> function drop(n) { if(self.moveBy){ self.moveBy (0, -900); for(i = n; i > 0; i--){ self.moveBy(0, 3); } for(j = 8; j > 0; j--){ self.moveBy(0,j); self.moveBy(j, 0); self.moveBy(0, -j); self.moveBy(-j, 0); } } } </script> <body onLoad="drop(300)"> |
3. I hate that many websites always open according to the default window. It would be great if you can control the opened window as you wish.
The code is as follows:
<SCRIPT LANGUAGE="JavaScript"> <! -- Begin function popupPage(l, t, w, h) { var windowprops = "location=no, scrollbars=no, menubars=no, toolbars=no, resizable=yes" + ", left=" + l + ", top=" + t + ", width=" + w + ", height=" + h; var URL = "http://www.80cn.com"; popup = window.open(URL, "MenuPopup", windowprops); } // End --> </script> <table> <tr> <td> <form name=popupform> <pre> Open page parameters<br> Distance from the left: <input type=text name=left size=2 maxlength=4> pixels Distance from the right: <input type=text name=top size=2 maxlength=4> pixels The width of the window: <input type=text name=width size=2 maxlength=4> pixels The height of the window: <input type=text name=height size=2 maxlength=4> pixels </pre> <center> <input type=button value="Open this window!" onClick="popupPage(this.form.left.value, this.form.top.value, this.form.width.value, this.form.height.value)"> </center> </form> </td> </tr> </table> |
You just need to enter a value in the corresponding dialog box, and the window of the page to be opened is well controlled.