JavaScript
  Home arrow JavaScript arrow The DOM Location Object Properties
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

The DOM Location Object Properties
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-12-01

    Table of Contents:
  • The DOM Location Object Properties
  • Hash It Up
  • Being a Good Host
  • Using Href
  • Getting the Pathname
  • Following Protocol

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    The DOM Location Object Properties


    (Page 1 of 6 )

    In this article we will cover the DOM Location Objects, which are used to set or return information regarding a user’s URL. Often considered an HTML DOM object, it is really more of a JavaScript object, created by the runtime engine. Like other objects, it consists of both Properties and Methods, the former of which we will be discussing today.

    There are eight Location Object properties in total and we will try to cover them as best we can here. They are the hash, host, hostname, href, pathname, port, protocol, and search, respectively. Below is a table showing what each one is used for:

     

    Name

    What It Does

    Type

    hash

    Used to set or retrieve the URL starting from the hash (#) symbol.

    Property

    host

    Used when you want to set or retrieve the port number and hostname of the URL.

    Property

    hostname

    Used to set or retrieve the hostname of the present URL.

    Property

    href

    Used to retrieve or set the entire URL.

    Property

    pathname

    Used to retrieve or set the pathname of the present URL.

    Property

    port

    Used to retrieve or set the port number of the present URL.

    Property

    protocol

    Used to retrieve or set the protocol of the present URL.

    Property

    search

    Used to retrieve or set the URL from the question (?) mark.

    Property

    More JavaScript Articles
    More By James Payne


     

    JAVASCRIPT ARTICLES

    - More on JavaScript Array Objects
    - Methods of the DOM Location Object
    - The DOM Location Object Properties
    - Handling Remote Files with JavaScript Click ...
    - Using Click Interceptions with a Database-Dr...
    - Using JavaScript Click Interceptions in an I...
    - Using Click Interceptions with JavaScript
    - QuickSort in Action
    - Quicksort
    - Using Mod_Security to Protect Your Server
    - Detecting and Countering Server Intrusions
    - Securing Your Web Server
    - Building a Secure Web Server
    - Protecting the Server
    - Book Review: Learning the Yahoo! User Interf...


     
    Best Practices for Windows Vista Migration Presentation
    Dell and Microsoft recently held a series of face-to-face seminars entitled, &qu....

     
    Creating a Culture for Code Reuse
    If you oversee development teams you know that like it or not proprietary and ex....

     
    Keys to Web Application Acceleration: Advances in Delivery Systems
    Accelerate Web apps by up to 5x. Ensure significantly faster access to the Web a....

     
    Optimizing Application Monitoring
    Tired of finding out from your customers that you're offline? This white paper e....

     
    Solaris to Solaris Migration -- Migrating applications from Sun SPARC to Dell PowerEdge R900
    This comprehensive Migration Guide reviews the approach that Principled Technolo....

     





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
    Stay green...Green IT