- in the last article we talked about the these two objects where each of them has its unique methods and properties
- you can check out the previous article to get more information JavaScript Browsers Object Model (BOM) Screen and Window
- its one of the objects of our browsers just the Window and Screen objects
- this object is used to get the URL of the current page you are running on your browser and redirect the browser to another new page
-Location object properties:
- location.href: this return the (URL) of the current page
- location.hostname:it'll give you the host name of your page for example www.google.com thats a host name but http://images.google.com this is an URL
- location.pathname: it'll return the path name of the URL for example our page URL is :
Host Name:www.basel.com
Path Name:computer/downloads/blogger.exe
- location.protocol: protocol is the way your browser connect to the web sites and for most web pages the protocol is HTTP and lets see some of them
- HTTP: For web pages
- SMTP:For mail sending
- FTP:Transfer files
- VOIP: For video calling just like Skype
- DNS: All websites on the internet have addresses so this protocol is used by the browsers to get the Ip of the page you wanted and give it back to your browser
- POP3:Mail sending
- UDP and TCP : these are connections protocol
- All these protocol aren't very important for web developing you don't have to learn a lot about them just read some information about what they do.
- location.assign(URL): this method is used to load a new document(Page) in your page you can pass the URL by putting it as a parameter
-Related to this post:
- JavaScript Browsers Object Model (BOM) Screen and Window
- Objects in JavaScript
- Functions in JavaScript
No comments:
Post a Comment