#1
  1. No Profile Picture
    Gone PHP Crazy
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    Melbourne, Australia
    Posts
    393
    Rep Power
    12

    Window.location.hash ?


    I got an input box of type button through which I run a javascript function. In the function I want to call some code which will get the scroll bars of the current window to scroll up to the very top to an anchor I have. I have the anchor named as follows:

    Code:
    <a name="top">Perception Questionnaire</a>
    and in the javascript function I have the following code:
    Code:
    window.location.hash=top;
    The above code I obtained by grasping some code as shown here: http://devedge.netscape.com/library/...ce/anchor.html

    But unfortunately my attempts with my code are not successful. Anyone know how to reference the anchor within the same window and able to send the location of the window to the achor. Thanks

    Jeffery
    visit http://www.techsatcomputers.com
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Apr 2003
    Location
    Italy, EU
    Posts
    517
    Rep Power
    12
    I'm not sure it will work, but have you tried to use a string for the assignment?

    window.location.hash="top";
    or
    this.location.hash="top";

    Hope this helps!
    Cheers, Dave

IMN logo majestic logo threadwatch logo seochat tools logo