JS code to close the current window

2010-08-12  来源:本站原创  分类:Web  人气:171 

onclick = "windows.close ();" is also OK, good compatibility, but the following points.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title> New Page 1 </ title>
<! -
by fason (2003-5-20)
->
</ Head>
<body>
<script language="JavaScript">
<! -
function CloseWin ()
(
var ua = navigator.userAgent
var ie = navigator.appName == "Microsoft Internet Explorer"? true: false
if (ie) (
var IEversion = parseFloat (ua.substring (ua.indexOf ("MSIE") +5, ua.indexOf (";", ua.indexOf ("MSIE "))))
if (IEversion <5.5) (
var str = '<object"clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">'
str + = '<param name="Command" value="Close"> </ object>';
document.body.insertAdjacentHTML ("beforeEnd", str);
document.all.noTipClose.Click ();
)
else (
window.opener = null;
window.close ();
)
)
else (
window.close ()
)
)
//-->
</ Script>
<input type=button value= Shut down >
</ Body>
</ Html>

相关文章
  • JS code to close the current window 2010-08-12

    onclick = "windows.close ();" is also OK, good compatibility, but the following points. <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="GENERATOR"

  • JS received all of the current window size value 2010-04-04

    JS Get all of the current window size values s = ""; s += "\r\n Web page visible area width :"+ document.body.clientWidth; s += "\r\n Web page visible area of the high :"+ document.body.clientHeight; s += "\r\n Web page

  • JS function to take the current window size 2010-12-13

    function getWindowSize () { return { Width: Math.max (document.body.scrollWidth, document.documentElement.clientWidth), Height: Math.max (document.body.scrollHeight, document.documentElement.clientHeight) } }

  • Pop-up window, window.open achieve Usage of (js code) 2010-03-25

    Pop-up window, window.open achieve Usage of (js code) [1] basic pop-up window code In fact, the code is very simple: <SCRIPT LANGUAGE="javascript"> <!-- window.open ('page.html') --> </SCRIPT> Because this is a javascripts code

  • js for the current window size value 2010-09-26

    <! DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.0 Transitional / / EN"> <HTML> <HEAD> <TITLE> New Document </ TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author&q

  • Practical and does not fancy the js code complete 2009-04-30

    Event source object event.srcElement.tagName event.srcElement.type Capture Release event.srcElement.setCapture (); event.srcElement.releaseCapture (); Events button event.keyCode event.shiftKey event.altKey event.ctrlKey Event return values event.ret

  • Super practical and do not fancy js Code Complete 2010-08-30

    Note: This article is copied someone else's code, I am not original. ************************************************** ************** Event source object event.srcElement.tagName event.srcElement.type Capture Release event.srcElement.setCapture ();

  • JS code is a small collection 2010-11-26

    click () object. click () so that the object is clicked. closed object. closed the window object is off true / false clearTimeout (object) remove the object has been set setTimeout clearInterval (object) to clear setInterval object has been set confi

  • If released to the JS code before you use it to add a compile step, we can do. 2010-12-17

    Recently read Hedger Wang's " Object-Oriented JavaScript Coding Better with Closure Compiler "( in Chinese ), regarded as a warm-D2. finally understand why this tool is called Google Compiler and not Compressor. Compared to compiled languages, J

  • Daquan js, javascript code, js code integration 2010-12-22

    Event source object event.srcElement.tagName event.srcElement.type Capture Release event.srcElement.setCapture(); event.srcElement.releaseCapture(); Events button event.keyCode event.shiftKey event.altKey event.ctrlKey Event return values event.retur

  • JS code management mechanism 2009-03-20

    Issue With the AJAX pop, JS in web applications, increasing over time. Attendant on the JS code maintenance and reuse on the need for a mechanism to manage. In addition to Java objects, classes of these concepts, there is also a flexible mechanism fo

  • NetEase said its free mail (163.126.Yeah.net) the js code 2009-10-22

    After roughly 163 free mail browser (126, Yeah.net and 163 of the js with the same way as a matter of fact, but not the same page and css), after the core js (the article has a context, see my previous articles), personal js feel their writing there

  • Js code commonly used Collection 2009-07-10

    [size = medium] [size = x-small] sk-net asp.net note-blog garden Home Home Subscribe to flash a new contact management Suibi -0 comments -1 Suibi -130 article highlights common js code 1. Oncontextmenu = "window.event.returnValue = false" will c

  • Ext developing plug-ins Spket (js code automatically prompt) 2010-04-02

    Spket IDE is the most outstanding support Ext 2.0 IDE. It uses. Jsb project file file and inherit the base class and all the contents of the document to be embedded in the code prompts the Script doc. As Spket just a simple editor, no other form of s

  • Photo Carousel js code 2010-06-30

    Js code photo carousel, concise! Can replace flash carousel features! <div> <SCRIPT language="javascript" type="text/javascript"> var widths=287; // Width var heights=242; // High var counts=4; // Displays the number of img

  • A dynamic three-dimensional display of pictures of Js code 2010-07-01

    Share a dynamic three-dimensional display of images Js code. . . Note: This code comes from a powerful friend the transfer js Sharing. . . <script type="text/javascript"> var Library = {}; Library.ease = function () { this.target = 0; this

  • Super simple js code can drag the layer 2010-07-04

    Transfer from: http://www.111cn.net/js_a/74/js+div+dl.htm Super simple js code can drag the layer <div onmousedown="Drag(this, event)"> </ div> <script> function Drag (o, e) ( var e = window.event | | e; var _x = e.offsetX | |

  • 73 pages common js code (switch) 2010-08-05

    73 pages common js code (switch) 1, back forward <input type="button" value=" Back "> <input type="button" value=" Forward "> 2, return <form> <input type="button" value=" To retu

  • JS code patterns (1) 2010-12-06

    Global variables Try not to use global variables in javascript, because 1. Global variable life cycle is long, long-term occupation of memory. 2.js code portability is not strong, if there is same name variable, the variable will be back in front of

  • Time and space of the JS code and calls 2011-01-10

    This is a JS code on the time and space to share them for your reference: <script type="text/javascript"> document.write("<div align='center''BORDER-RIGHT: #000000 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #000000 1px solid; PADDI