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