eHow launches Android app: Get the best of eHow on the go.

How To

How to Use the VBScript Location Object

Contributor
By eHow Contributing Writer
(2 Ratings)

Use the location object in VBScript to mark the location of your URL within the code. Each page you set up under your main URL has its own location object, which you can leverage later on in your code to display that page. Use the location object to refresh your current web page, reload the page with a different URL within the location object or use it to gather the name of the current URL. Input a question mark to find a particular URL with the location object.

Difficulty: Moderately Easy
Instructions
  1. Step 1

    Use the location objects "href" property to reference the document in your script. Place the string "location.href=document.nameofyourURL.andsubpage.value" in your function, where "nameofyourURL.andsubpage" are exactly that the name of your URL and then put a period between the subpage heading with no spaces. This takes you to your web page when the VBScript performs the function.

  2. Step 2

    Populate your script with an alternative method if you do not know the "href" property of your URL. Use the established method "toString ()" to return the value of the property in place of the "href" reference in Step 1.

  3. Step 3

    Write a query in VBScript and include "location" as a variable. The query searches through your web pages for URLs and returns the names to you. Specify in the query if you want the "href" name or the method name returned.

  4. Step 4

    Assign one URL or many different URLs to go to when a button on your web page is pressed. Enter "location=document.yourform.yourlist.value" into your script. Assign a form and then enter URLs for your list. Include just one or many to display a list of possible URLs.

Comments  

mizzshady said

Flag This Comment

on 9/24/2009 nope not easy at all that went over my head.. I'm so lost... And I'm going to need a website soon.. I cant seem to get an understanding for how it all works. Still trying to figure out how to tie in css with html... wow I will just keep on trying to understand it.

Post a Comment

Post a Comment
  • Have you done this? Click here to let us know.
I Did This

Related Ads

Internet
Virginia DeBolt,

Meet Virginia DeBolt eHow's Internet Expert.

Get Free Internet Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy.   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.

Demand Media
eHow_eHow Technology and Electronics