40 kinds of page useful tipsHere is the javascript 40 page useful tips for website developers believe will be helpful. 1. oncontextmenu = window.event.returnValue = false will completely shield Right table border oncontextmenu = return (false) tdno / table can be used to Table2. Body onselectstart = return false unchecked, prevent copying 3. onpaste = return false paste allowed 4. oncopy = return false; oncut = return false; 2015 Latest Nike Shoes prevent copy 5. link rel = Shortcut Icon href = before favicon.ico IE address bar into your own icons 6. link rel = Bookmark href = favicon.ico in favorites the icon shows your 7. input style = ime-mode: disabled Close input method 8. The framework will always be with the script language = JavaScript - if (window == top) top.location.href = frames.htm;! //frames.htm for the frames page // - / script9 prevent being frameSCRIPT LANGUAGE = JAVASCRIPT - if (top.location = self.location!) top.location = self.location;.! // - / SCRIPT10 . page will not be saved as noscriptiframe src = / blog / * html; / iframe / noscript 11. input type = button value = View page source onclick = window.location = view-source: + http: // www. . williamlong.info12 confirm the deletion a href = javascript: if (confirm (you sure you want to delete it)?) location = boos.asp areyou = Delete Delete page = 1 / a _fcksavedurl = javascript:? if (confirm (you sure you want to delete it ??)) location = boos.asp areyou = Delete Delete page = 1 / a 13. acquire control of absolute position // Javascriptscript language = Javascriptfunction getIE (e) {var t = e.offsetTop; var l = e.offsetLeft; while (e = e.offsetParent) alert (top = + t + / nleft = + l);!} / script // VBScriptscript language = VBScript - function getIE () dim t, l, a, bset a = document.all .img1t = document.all.img1.offsetTopl = document.all.img1.offsetLeftwhile a.tagNameBODYset a = a.offsetParentt = t + a.offsetTopl = l + a.offsetLeftwendmsgbox top = tchr (13) left = l, 64, . get control position end function - / script14 cursor rests on a text box is the text of the final script language = javascriptfunction cc () {var e = event.srcElement; var r = e.createTextRange (); r.moveStart (character, . e.value.length); r.collapse (true); r.select ();} / scriptinput type = text name = text1 value = 123 onfocus = cc () 15 determine the source of previous javascript: document.referrer16 . minimize, maximize, close the window object id = hh1 classid = clsid: ADB880A6-D8FF-11CF-9377-00AA003B7A11 param name = Command value = Minimize / objectobject id = hh2 classid = clsid: ADB880A6-D8FF-11CF-9377- 00AA003B7A11 param name = Command value = Maximize / objectOBJECT id = hh3 classid = clsid: adb880a6-d8ff-11cf-9377-00aa003b7a11PARAM NAME = Command VALUE = Close / OBJECTinput type = button value = minimize onclick = hh1.Click () input type = button value = maximize onclick = hh2.Click () input type = button value = closed onclick = hh3.Click () This example is for IE17. Shielding function keys Shift, Alt, Ctrlscriptfunction look () {if (event.shiftKey ) alert (press Shift key is prohibited);! // can be replaced with ALT CTRL} document.onkeydown = look; / script18 pages are not cached META HTTP-EQUIV = pragma CONTENT = no-cacheMETA HTTP-EQUIV = Cache-Control. CONTENT = no-cache, must-revalidateMETA HTTP-EQUIV = expires CONTENT = Wed, 26 Feb 1997 08:21:57 GMT or META HTTP-EQUIV = expires CONTENT = 019. How to make the form not of concavity? input type = text style = border: 1 solid # 000000 or input type = text style = border-left: none; border-right: none; border-top: none; border-bottom:? difference 1 solid # 000000 / textarea20.divspanlayer of div (division ) is used to define a large section of the page elements, will have to switch to span is used to define the elements within the same line, with the only difference is that no switch div layer is ns mark, ie do not support, equivalent div21. Let the pop-up window always at the top: body onblur = this.focus (); 22 do not scroll bars do not allow:. body style = overflow:? scroll; overflow-y: hidden / body so that the bar did not: body style = overflow: scroll; overflow-x:?? hidden / body removed both simpler body scroll = no / body 23. How to remove the image link click, the dotted line around the image of a href = # onFocus = this.blur () img src = / . blog / logo.jpg border = 0 / a24 mail processing to submit the form form name = form1 method = post action = http: //www.williamlong.info12 confirmation when deleting a href = javascript:. if (confirm (you sure you want to delete ?? it)) location = boos.asp areyou = Delete Delete page = 1 / a _fcksavedurl = javascript: if (confirm (you sure you want to delete it)) location = boos.asp areyou = Delete Delete page = 1 / a 13?? . obtain the absolute position of the control // Javascriptscript language = Javascriptfunction getIE (e) {var t = e.offsetTop; var l = e.offsetLeft; while (e = e.offsetParent) alert (top = + t + / nleft = + l );!} / script // VBScriptscript language = VBScript - function getIE () dim t, l, a, bset a = document.all.img1t = document.all.img1.offsetTopl = document.all.img1.offsetLeftwhile a .tagNameBODYset a = a.offsetParentt = t + a.offsetTopl = l + a.offsetLeftwendmsgbox top = tchr (13) left = l, 64, to get the position of the control end function -. / script14 cursor is parked in the text box text The last script language = javascriptfunction cc () {var e = event.srcElement; var r = e.createTextRange (); r.moveStart (character, e.value.length); r.collapse (true); r.select () ;} / scriptinput type = text name = text1 value = 123 onfocus = cc () 15 determine the source of previous javascript:.. document.referrer16 minimize, maximize, close the window object id = hh1 classid = clsid: ADB880A6- D8FF-11CF-9377-00AA003B7A11 param name = Command value = Minimize / objectobject id = hh2 classid = clsid: ADB880A6-D8FF-11CF-9377-00AA003B7A11 param name = Command value = Maximize / objectOBJECT id = hh3 classid = clsid: adb880a6- d8ff-11cf-9377-00aa003b7a11PARAM NAME = Command VALUE = Close / OBJECTinput type = button value = minimize onclick = hh1.Click () input type = button value = maximize onclick = hh2.Click () input type = button value = Close onclick = hh3.Click () This example is for IE17 shielding function keys Shift, Alt, Ctrlscriptfunction look () {if (event.shiftKey) alert (press the Shift key is prohibited!); // can be replaced with ALT CTRL}. document .onkeydown = look;. / script18 pages are not cached META HTTP-EQUIV = pragma CONTENT = no-cacheMETA HTTP-EQUIV = Cache-Control CONTENT = no-cache, must-revalidateMETA HTTP-EQUIV = expires CONTENT = Wed, 26 . Feb 1997 08:21:57 GMT or META HTTP-EQUIV = expires CONTENT = 019 How to make the form not of concavity input type = text style = border:? 1 solid # 000000 or input type = text style = border-left: none ; border-right: none; border-top: none; border-bottom:? difference 1 solid # 000000 / textarea20.divspanlayer of div (division) is used to define a large section of the page elements, will have to change jobs within the same line used to define the span elements, with the only difference is that no switch div layer is marked ns of, ie does not support, equivalent div21 allow pop-up windows are always on top:. body onblur = this.focus (); Nike Air Max 90 Premium 22 Do not scroll bar.? Let bars do not: body style = overflow: scroll; Air Jordan 5 overflow-y: hidden / body so that the bar did not: body style = overflow: scroll; overflow-x:? hidden / body removed both simpler body scroll = no After / body 23. How to remove the image link click, the dotted line around the picture? a href = # onFocus = this.blur () img src = / blog / logo.jpg border = 0 / a24. mail processing to submit the form form name = form1 method = post action = mailto:. **** @ *** com enctype = text / plain input type = submit / form25 open child windows in the parent window to refresh the code in how to write window.opener.location.?. . reload () 26 How to set the size of the page to open the body onload = top.resizeTo (300,200); open page where body onload = top.moveBy (300,200);. 27 pages how to join is not in the shop for the background image, when you pull the page background does not move STYLE body {background-image: url (/blog/logo.gif); background-repeat: no-repeat; background-position: center; background-attachment: fixed} / STYLE 28. Check the period whether the whole string of digits script language = Javascript -! function checkNum (str) {return str.match (// D /) == null} alert (checkNum (1232142141)) alert (checkNum (123214214a1)) // .. - / script29 get a window size document.body.clientWidth; document.body.clientHeight30 how to determine whether a character if (/[^/x00-/xff]/g.test(s)) alert (containing Chinese characters ); else alert (all characters); How many textarea rows 31.TEXTAREA adaptive number of text rows = 1 name = s1 cols = 27 onpropertychange = this.style.posHeight = this.scrollHeight / textarea32 date minus the number of days equal to the first two date script language = Javascriptfunction cc (dd, dadd) {// can add error handling var a = new Date (dd) a = a.valueOf () Personality Nike Air Force 1 Unisex White Blue Shoes a = a - dadd * 24 * 60 * 60 * 1000a = new Date (a) alert (a.getFullYear () + Year + (a.getMonth () + 1) + month + a.getDate () + day)} cc (12/23 / 2002,2) / script33. Choose which one RadioHTMLscript Popular Nike Air Force 1 Unisex White Black Shoes language = vbscriptfunction checkme () for each ob in radio1if ob.checked then window.alert ob.valuenextend function / scriptBODYINPUT name = radio1 type = radio value = style checkedStyleINPUT name = radio1 type = radio value = barcodeBarcodeINPUT type = button value = check onclick = checkme () / BODY / HTML34 script never wrong SCRIPT LANGUAGE = JavaScript - Hide function killErrors ().! {return true;} window.onerror = killErrors; // - /SCRIPT35.ENTER key Let the cursor to the next input box input onkeydown = if (event.keyCode == 13) event.keyCode = 936 detects a site link speed: the following code to body regions: script language = Javascripttim = 1setInterval (tim ++ , 100) b = 1var autourl = new Array () autourl [1] = www.njcatv.netautourl [2] = javacool.3322.netautourl [3] = www.sina.com.cnautourl [4] = www.nuaa. edu.cnautourl [5] = www.cctv.comfunction butt () {document.write (form name = autof) for (var i = 1; iautourl.length; i ++) document.write (input type = text name = txt + i + size = 10 value = / blog / test ...... = 'input type = text name = url + i + size = 40 =' input type = button value = GO onclick = window.open (this.form. url + i + .value) br) document.write (input type = submit value = refresh / form)} butt () function auto (url) elseb ++} function run () {for (var i = 1; iautourl.length; i ++ ) document.write (img src = http: //+autourl+/+Math.random () + width = 1 height = 1 onerror = auto (http: // + autourl +).)} run () / script37 variety of styles The cursor auto: standard cursor default: standard arrow hand: hand cursor wait: wait cursor text: I-shaped cursor vertical-text: level I-shaped cursor no-drop: can not drag the cursor not-allowed: Invalid Cursor help:? Help cursor all-scroll: Triangle direction superscript move: mobile standard crosshair: Cross Standard e-resizen-resizenw-resizew-resizes-resizese-resizesw-resize38 page entry and exit effects to enter the page meta http-equiv = Page-Enter content = revealTrans. (duration = x, transition = y) Release page meta http-equiv = Page-Exit content = revealTrans (duration = x, transition = y) this is some special effects to bring up the page is loaded and when. duration indicates the duration of the effects, in seconds. transition indicates what type of effects, ranging from 1-23: 0 1 rectangle expand narrow rectangle 2 round 3 round widen narrowed down to 4 5 to the next refresh refresh refresh 7 6 left-to-right and right-to-left vertical refresh 8 Blinds horizontal blinds 9 10 11 displaced horizontal louver blinds, vertical misalignment 12:00 diffusion around 13 to the intermediate refresh refresh 15 to about 14 middle and down 16 up and down the middle to the lower right to the upper left to the middle 17 18 19 upper right to the lower left to the upper left to lower right 20 left 21 right upper bar 22 bars 23 randomly selected more than 22 kinds of jumps within a prescribed time 39. META http-equiv = V = REFRESH content = 5; URL = http: //www.williamlong.info 40. page is retrieved meta name = ROBOTS content = attribute value where property values are the following: Property is all: the file will be retrieved, and the page links can be queried; property value none: document will not be retrieved, but does not query the page links; property value index: files will be retrieved; property value follow: links on the query page; property value noindex: document does not retrieve, but can be queried link; property value nofollow: document will not be retrieved, but Links can be found on the page. ? Maximize Window script language = JavaScript - self.moveTo (0,0) self.resizeTo (screen.availWidth, screen.availHeight) // - / script to solve the problem:! Since the priority layer between the drop-down box They are: drop-down box layers, so when the display because of the order of priority and will appear as a problem. (If several elements are level, then we can set the z-index attribute Layer) solution is: to put a layer in the drop-down box a higher priority than the elements (iframe), so as to solve this problem! Specific solutions codes are as follows: div id = menu style = position: absolute; visibility: hidden; top: 20px; left: 20px; width: 100px; height: 200px; background-color: # 6699cc; table trtditem 1 / td / tr trtditem 2 / td / tr trtditem 3 / td / tr trtditem 4 / td / tr trtditem 5 / td / tr / table iframe src = / blog / javascript: false style = position: absolute; visibility: inherit; top: 0px; left: 0px; width: 100px; height: 200px; z-index: -1; filter = 'progid: DXImageTransform.Microsoft.Alpha (style = 0, opacity = 0)'; / iframe / diva href = # _fcksavedurl = # onclick = document.getElementById ('menu'). style.visibility = 'visible'menu / aform selectoptionA form selection list / option / select / form input box can do very beautiful div align = centerinput type = hidden name = hao value = yes outgoing number: input name = answer style = color: rgb (255,0,0); border-left: medium none; border-right: medium none; border-top: medium none; border-bottom: 1px solid rgb ( 192,192,192) did not answer a number of questions: input name = unanswer id = unanswer style = color: rgb (255,0,0); border-left: medium none; border-right: medium none; border-top: medium none; border -bottom: 1px solid rgb (192,192,192) br Total score: input name = score id = score style = color: rgb (255,0,0); border-left: medium none; border-right: medium none; border-top : medium none; border-bottom: 1px solid rgb (192,192,192) Conclusion: input name = xgjg id = xgjg style = color: rgb (255,0,0); border-left: medium none; border-right: medium none; border-top: medium none; border-bottom: 1px solid rgb (192,192,192) br br input onClick = processForm (this.form) style = FONT-FAMILY: Arial; FONT-SIZE: 9pt type = button value = View Results name = button input type = reset name = Submit value = Redo / div Note: Modifying body to body onload = max.Click () is open maximized window, and if instead body onload = min.Click () becomes window opened on minimizing the object id = min type = application / x-oleobject classid = clsid: adb880a6-d8ff-11cf-9377-00aa003b7a11 param name = Command value = Minimize / object object id = max type = application / x-oleobject classid = clsid: adb880a6-d8ff-11cf-9377-00aa003b7a11 param name = Command value = Maximize / object / body pages automatically refresh (Note) When you do web Air Jordan 7 pages, is not sometimes want to keep your pages automatically refresh, or a period of time automatically jump to another page you set yourself? In fact, to achieve this effect is very simple, and this effect can not even be called effects. You just put the following code on your web pages on it. 1, pages automatically refresh: the following code to head area meta http-equiv = refresh content = 20, where 20 means that every 20 seconds to refresh the page .2, the page Beautiful Nike Air Force 1 High Womens Black Pink Shoes automatically jump: the following code to the head region meta http -equiv = refresh content = 20; url = http: //www.williamlong.info, which refers to the interval 20 to 20 seconds after the jump http://www.williamlong.info page. Page 5000 is shut down automatically mean time body onLoad = setTimeout (window.close, 5000) pop-up window automatically closes pop-up window after 10 seconds automatically shut down Note: In the new tan.htm the body should add onLoad = closeit () headscript language = ! JavaScript - var gt = unescape ('% 3e'); var popup = null; var over = Launch Pop-up Navigator; popup = window.open ('', 'popupnav', 'width = 225, height = 235 , resizable = 1, scrollbars = auto '); if (popup = null) {if (popup.opener == null) {popup.opener = self;} popup.location.href =!' tan.htm ';} / / - / scriptbody Note: The code is in the new file script language = JavaScriptfunction closeit () / script this is not iframe (reference) Yeah. It is a direct call. The following code to body area object type = text / x-scriptlet width = 800 height = 1000 data = .. / index.htm / object