JavaScript Learning 2

Source: Internet
Author: User

the last time we learnedJavaScript provides a set of window-centric objects that enable access control of the browser window. There are 6 important objects defined in javascript:
      • The Window object represents the windows that are open in the browser;
      • The Document object represents the file object that loads the page in the browser;
      • The Location object contains the current URL information of the browser;
      • The Navigation object contains the information of the browser itself;
      • The Screen object contains information about the client screens and rendering capabilities;
      • The History object contains historical information about the browser's access to the Web page.
For/in Cycle

The JavaScript for/in statement loops through the properties of the object:

inperson)  {  txt=txt + person[x];  }
application of JavaScript try Catch :
<script>
function MyFunction ()
{
Try

var X=document.getelementbyid ("Demo"). Value;
if (x== "") throw "value is null";
if (IsNaN (x)) throw "is not a number";
if (x>10) throw "too large";
if (x<5) throw "too small";
}
catch (Err)
{
var Y=document.getelementbyid ("mess");
Y.innerhtml= "Error:" + Err + ". ";
}
}
</script>

JavaScript Learning 2

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.