Some useful auxiliary code used in Web page making

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

Click to return to the previous page code:





Pop-up warning Box code:





Click to open a new window





Pop-up confirmation box when deleting a record:


Close an open window
"A href="/"> close window

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 the link information that appears in the status bar
Web Teaching web

text box automatic scroll bar


Select all and copy


Hello, welcome to your visit!

Masking JavaScript errors


Refresh parent window when child window is closed



Background color transformation






Check whether a string of strings is composed entirely of digits


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>

Let the layer not be covered by the control code:
<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>

Let the relative position of the layer
<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 ">
Content
</div> </div>

Flash code and background transparency
<object classid= "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase= "http://download.macromedia.com/pub/ shockwave/cabs/flash/swflash.cab#version=6,0,29,0 "width=" height= "200"
<param name= "movie" value= "file"
<param name= "Quality" value= "high"
<param name= "wmode" value= "Transparent"
<embed src= "http://www.webjx.com/htmldata/2007-01-24/images/fish.swf" quality= "High" pluginspage= "http://" Www.macromedia.com/go/getflashplayer "type=" Application/x-shockwave-flash "width=" "height=" " 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.