JavaScript: fault-tolerant and fully maximize the browser automatically

Related Tags:

  Error code dealing with the immediate establishment of JavaScript code we sometimes the result of our negligence, there are some mistakes, so that users will be browsing is annoying pop-up error messages framework for how to deal with such a situation?    Here are two common methods: 

  (1) fully fault-tolerant 

  That the users to browse the pages containing the error code, ignore all the mistakes.    Code as follows: 

  <script> 

  Function killerr () ( 

  Return true 

  ) 

  Window.onerror = killerr 

  </ Script> 

  Although it can cover up the errors, mistakes to avoid pop-up boxes, but has yet to correct implementation procedures, another approach is presented below. 

  (2) Feedback wrong message 

  That is, when an error code, we pre-designed automatic pop-up window good feedback to users simply click the mouse on the feedback information can be sent to designated mailboxes you, of course, the content of our feedback window can be modified Design.    Code as follows: 

  <script> 

  Function errorinfo () 

  ( 

  Errorwin = window.open ( "", "", "width = 20, Height = 120") 

  Errorwin.document.write ( '<title> script error report </ title> <center> the pages of the script that operational errors, please <a href = "mailto: lhy@cenpok.net"> notice </ a> 
  Administrator.    <br> <form> <Input type = "button" value = "Close Window" onCli 
  Ck = "window.close ()"></ form> </ center> ') 

  Errorwin.document.close () 

  Errorwin.document.bgColor = "# ffffff" 

  Return true 

  ) 

  Window.onerror = errorinfo 

  </ Script> 

  Optimization browser window 

  Use this code when the user opens your page, the browser window will be automatically extended to the maximum use of space (full-screen), is not very professional? 

  The following code on <head> </ head> between: 

  <script Language="JavaScript"> 

  <! - Function winfix () ( 

  If (document.layers) ( 

  Width = screen.availWidth-10; 

  Height = screen.availHeight-20; 

  Else () 

  Var width = screen.availWidth-2; 

  Var height = screen.availHeight; 

  ) 

  Self.resizeTo (width, height); 

  Self.moveTo (0, 0); 

  ) 

  //--> 

  </ Script> 

  The following code on the <body> Tag Lane: 

  <body Onload="winfix()"> 

Related articles:

Ajax perfect solution to a troublesome problem
  CEOs recently to a small function, in the search list of Internet cafes with Internet cafes owned agents this condition, conditions of the original search area is a two linked, according to different needs of different areas showed that the agent pool.    That is the trigger in the...
CSS layout + DIV Guide
  CSS is Cascading Style Sheets (Cascading Style Sheets) initials.    Documents on the web is a simple mechanism for adding style, performance belongs to the layout of the language.    1. Basic grammatical norms    CSS analysis of a typical phrase:    ...
XHTML norms and the use of the experience
  1, xhtml is re-formed XML 1.0 with the HTML 4.    2, a simple and comprehensive xhtml should be so (for the majority of Chinese people):    <? Xml version = "1.0" encoding = "gb2312?">    <! DOCTYPE html    PUBLIC "...
Swf file number will be called the flash of an EXE file
  A friend of mine the other day that in many forums asked the same question --    Packing more SWF released into EXE?    Packing more SWF released into EXE?    FLASH done in a index.swf 1.swf 2.swf 3.swf 4.swf 5.swf 6.swf 7.swf 8.swf 9.swf this 10 SWF files whi...
Google's special features
  Google's special features brief    1, enquiries numbers    Google's search joined the column as telephone numbers and street addresses for the United States information.    If individuals would like to find these lists, as long as their names, cities ...