Recommendation: Web page production of common code collection

Source: Internet
Author: User
Tags copy relative reset return version window
Web page

Click to return to the previous page code:
<form>
<p><input type= "button" value= "Back to previous step" ></p>
</form>

Pop-up warning Box code:
<form>
<p><input type= "button" value= "Pop-up warning box" ></p>
</form>
<script language= "JavaScript" ><!--
function Alertbutton () {Window.alert! ");}
--></script>

Click to open a new window
<form>
<p><input type= "button" value= "open new Window" ></p>
</form>
<script language= "JavaScript" ><!--
function NewWindow () {window.open ("http://www.mcmx.com", "", "height=240,width=340,status=no,location=no,toolbar= No,directories=no,menubar=no ");}
--></script></body>

Pop-up confirmation box when deleting a record:
<script language= "VBSCRIPT" >
A=msgbox ("Do you really want to delete this record?") ", 1," note ")
If A=1 Then
location= "dodelete.asp?id=<%=id%>"//point to the page performing the deletion dodelete.asp
Else
History.go (-1)
End If
</script>

Close an open window
< a href= "/" > Close window </a>

Empty input and select

Right-click Mask
<body oncontextmenu=self.event.returnvalue=false>

How to solve the line-wrapping in English IE5.5
Style= "left:0px; width:100%; Word-wrap:break-word "You can modify to a specified size such as 200px

Picture "Reset" button
<script language= "JScript" >
function Myreset ()
{Document.login.reset ();
Document.login.focus ();}
</script>

Draw a thin form
<table style= "Border-collapse:collapse" >

Status bar Information
<form>
<p><input type= "button" value= "status bar Info" ></p>
</form>
<script language= "JavaScript" ><!--
function Statusbutton () {window.status= "to visit!" ";}
--></script>

Minimize, maximize, close windows
<object id=hh1 classid= "Clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" >
<param name= "Command" value= "Minimize" ></object>
<object id=hh2 classid= "Clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" >
<param name= "Command" value= "Maximize" ></object>
<object id=hh3 classid= "Clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" >
<param name= "Command" value= "Close" ></OBJECT>

<input Type=button value= Minimize onclick=hh1. Click () >
<input Type=button value= maximize ONCLICK=HH2. Click () >
<input Type=button value= closes Onclick=hh3. Click () >
This example applies to IE

Hide link information appearing in the status bar
<a href= "http://"; > Dream Sky </a>

text box automatic scroll bar
<textarea name=words rows=18 cols=26 style= "border:1 solid  #000000; Background-color:white; font-size:9pt; width:188; overflow: Auto " wrap=hard></textarea>


<FORM name=test><INPUT  type=button  value= all Select and copy ><BR><TEXTAREA name=select1 rows=3 cols=46> Hello, welcome to your visit! </TEXTAREA>&NBSP
</form>
<script language=javascript> 
<!-- 

var copytoclip=1 

Function highlightall (Thefield)  { 
Var tempval= Eval ("document.") +thefield)  
Tempval.focus ()  
Tempval.select ()  
if  (document.all&& copytoclip==1) { 
Therange=tempval.createtextrange ()  
Therange.execcommand ("Copy")  
Window.status= "contents highlighted and copied to clipboard!" &NBSP
settimeout ("window.status=", 1800)  


//--> 
</SCRIPT>

Masking JavaScript errors
<script language= "JavaScript" >
<!--
function Killerrors () {
return true;
}
Window.onerror = killerrors;
-->
</script>

Refresh parent window when child window is closed
<script language= "JavaScript" >
<!--
Self.opener.location.reload ();
Window.close ()
-->
</script>

Background color transformation
<form>
<p><input type= "button" value= "Background color transformation" ></p>
</form>
<script>function Bgbutton () {
if (document.bgcolor== ' #00ffff ')
{document.bgcolor= ' #ffffff ';}
Else{document.bgcolor= ' #00ffff ';}
}
</script>

Check whether a string of strings is composed entirely of digits
<script language= "Javascript" ><!--
function Checknum (str) {return Str.match (//d/) ==null}
Alert (Checknum ("1232142141"))
Alert (Checknum ("123214214A1"))
--></script>

Judge whether it is a character
if (/[^/x00-/xff]/g.test (s)) alert ("contains Chinese characters");

Click the Refresh code:
<form>
<p><input type= "button" value= "refresh button One" ></p>
</form>
<script language= "JavaScript" ><!--
function Reloadbutton () {location.href= "allbutton.htm";}
--></script>


<div z-index:2><object xxx></object ></div> #  front  
<div z-index:1><object xxx></object></ div> #  behind  
<div id= Layer2 " style=" position:absolute; top:40;width : 400px; height:95px;z-index:2 "><table height=100% width=100% bgcolor=" #ff0000 "> <tr><td height=100% width=100%></td></tr></table><iframe width =0 height=0></iframe></div>
<div id= "Layer1"  style= "Position:absolute";  top:50;width:200px; height:115px;z-index:1 "><iframe height=100% width=100%></ iframe></div> 


<div id= Layer1 " style=" position:relative;  Left:0px; top:0px; width:0px; height:0px;z-index:1 "> 
<div id=" Layer2 "  Style= "Position:absolute; left:500px; top:0px; width:220px; height:220px; z-index:1" >&NBSP
Content
</div></div>

flash code and background transparency
<object classid= CLSID:D 27cdb6e-ae6d-11cf-96b8-444553540000 " codebase=" http://download.macromedia.com/pub/shockwave/cabs/flash/ swflash.cab#version=6,0,29,0 " width=" " height=" "" "
<param name=" movie " value = "File"
<param name= "quality"  value= "High"
<param name= wmode " value=" Transparent ""
<embed src= "http://www.webjx.com/htmldata/2006-12-20/images/fish.swf"  quality = "High"  pluginspage= "Http://www.macromedia.com/go/getflashplayer"  type= "application/" X-shockwave-flash " width="  height= "," ></EMBED></OBJECT>&NBSP;

Windows Media player player
<object Id=mediaplayer1
Style= "left:0px; visibility:visible; Position:absolute; Top:0px;z-index:2 "
codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=5,1,52,701standby=

Loading
Type=application/x-oleobject height=300 width=320
Classid=clsid:6bf52a52-394a-11d3-b153-00c04f79faa6 viewastext>
<param name= "URL" value= "Address" >

<param name= "Audiostream" value= "-1" >
<param name= "AutoSize" value= "0" >
<param name= "AutoStart" value= "-1" >
<param name= "Animationatstart" value= "0" >
<param name= "Allowscan" value= "-1" >
<param name= "Allowchangedisplaysize" value= "-1" >
<param name= "Autorewind" value= "0" >
<param name= "Balance" value= "0" >
<param name= "BaseURL" value>
<param name= "Bufferingtime" value= "5" >
<param name= "Captioningid" value>
<param name= "Clicktoplay" value= "-1" >
<param name= "CursorType" value= "0" >
<param name= "currentposition" value= "-1" >
<param name= "Currentmarker" value= "0" >
<param name= "Defaultframe" value>
<param name= "Displaybackcolor" value= "0" >
<param name= "Displayforecolor" value= "16777215" >
<param name= "DisplayMode" value= "0" >
<param name= "Displaysize" value= "4" >
<param name= "Enabled" value= "-1" >
<param name= "Enablecontextmenu" value= "-1" >
<param name= "Enablepositioncontrols" value= "0" >
<param name= "Enablefullscreencontrols" value= "0" >
<param name= "Enabletracker" value= "-1" >
<param name= "Invokeurls" value= "-1" >
<param name= "Language" value= "-1" >
<param name= "Mute" value= "0" >
<param name= "Playcount" value= "1" >
<param name= "PreviewMode" value= "0" >
<param name= "Rate" value= "1" >
<param name= "Samilang" value>
<param name= "Samistyle" value>
<param name= "Samifilename" value>
<param name= "SelectionStart" value= "-1" >
<param name= "Selectionend" value= "-1" >
<param name= "sendopenstatechangeevents" value= "-1" >
<param name= "sendwarningevents" value= "-1" >
<param name= "senderrorevents" value= "-1" >
<param name= "sendkeyboardevents" value= "0" >
<param name= "sendmouseclickevents" value= "0" >
<param name= "sendmousemoveevents" value= "0" >
<param name= "sendplaystatechangeevents" value= "-1" >
<param name= "showcaptioning" value= "0" >
<param name= "Showcontrols" value= "-1" >
<param name= "Showaudiocontrols" value= "-1" >
<param name= "Showdisplay" value= "0" >
<param name= "Showgotobar" value= "0" >
<param name= "Showpositioncontrols" value= "-1" >
<param name= "ShowStatusBar" value= "-1" >
<param name= "Showtracker" value= "-1" >
<param name= "Transparentatstart" value= "-1" >
<param name= "videoborderwidth" value= "0" >
<param name= "Videobordercolor" value= "0" >
<param name= "Videoborder3d" value= "0" >
<param name= "Volume" value= ">"
<param name= "Windowlessvideo" value= "0" >
</OBJECT>

RealPlayer player
<object id=video1 classid= "CLASID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA"
width=320 height=240 align= "Middle" >
<param name= "Controls" value= "Inagewindow" >
<param name= "Console" value= "CHICP1" >
<param name= "AutoStar" value= "true" >
<param name= "src" value= "address" >
<embed
src= "Address"
Type= "Audio/x-pn-realaudio-plugin" console= "Chip1"
controls= "Imagewindow" width=320 height=240 autostart=true align= "Middle" >
</embed>
</object>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.