tags:

views:

68

answers:

3

I there a way in javascript to make the page jump to a specific location on the page, such as

<span id='jump_to_this_location'></span>

I do not want to re=load page,

+7  A: 

You can set the location.hash property, like this:

window.location.hash = "jump_to_this_location";

You can give it a try here.

Nick Craver
+2  A: 

You don't need JS for that.

Accessing yourpage.html#jump_to_this_location will do. This can be done through a link (<a href="#jump_to_this_location">jump</a>)

quantumSoup
@quantumsoup a good answer but "a way in javascript to..." kind of defeats your solution. :-(
Chris
+1  A: 

This can be accomplished by first creating an anchor for the page landing spot using HTML.

<a name="jumpHere">somewhere</a>

Once you have the landing site, simply use the JavaScript:

window.location = 'yoursite.html#jumpHere';
Moses