<JavaScript> Nine. BOM Other objects (screen object, navigator object, location Address bar object, History record Object)

Source: Internet
Author: User

1 <!DOCTYPE HTML>2 <HTML>3 <Head>4     <title></title>5 <Scripttype= "text/javascript">6 7 /*8 Screen Object9 -------------------property---------------------Ten width : Screen width one height : Screen Height a availwidht: effective width, without taskbar - availheight: effective height, without taskbar - are read-only properties the */ - varStr= "" - Str+= "Width:" +Screen.width+ ", Height:" +Screen.height+ "<br>"; - Str+= "effective Width:" +Screen.availwidth+ ", effective height:" +Screen.availheight+ "<br>"; + document.write (str); - document.write (""); +  a /* at Navigator Browser Object - -------------------property--------------------- - appName: software name - appversion: Core Version - systemlanguage: System Language - userlanguage: User Language in platform: User Platform - */ to varStr= ""; + Str+= "appName:" +navigator.appname; - Str+= "<br>appversion:" +navigator.appversion; the Str+= "<br>systemlanguage:" +navigator.systemlanguage; * Str+= "<br>userlanguage:" +navigator.userlanguage; $ Str+= "<br>platform:" +navigator.platform;Panax Notoginseng document.write (str); - document.write (""); the  + /* a Location Address bar Object the -------------------property--------------------- + Href: Get the full address, can realize the JS page jump - host: hostname $ hostname: Host name $ pathname: file path and filename - search: Query string - protocol: protocol/http/ftp:// the hash: anchor name #top - Reload (true): Refresh Web page, True indicates forced refreshWuyi */ the //3 seconds to jump Baidu - //window.settimeout ("location.href = ' http://www.baidu.com '", +); wu  - /* about Histroy History Object $ -------------------property--------------------- - length: number of history records - go (n): forward N page - Go (0): Refresh a go (-n): back N page + forward (): forward the Back (): Rewind - */ $ </Script> the </Head> the <Body> the  the <!--Address bar Object - - <inputtype= "button"value= "refresh page"onclick= "javascript:location.reload (true)"> in <HR> the  the <!--History Object - about <ahref= "news.html">News</a> the <inputtype= "button"value= "forward"onclick= "history.go (1)"> the  the </Body> + </HTML>

<JavaScript> nine. BOM other objects (screen object, navigator object, location Address bar object, History record Object)

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.