views:

32

answers:

3

What I'm trying to do is to create a link on the same page to a java applet link for which I don't have the parameters. Take a look at any of the chessboards at Chesscalisthenics.com

+1  A: 

There's no "link" to xy positions, but from Javascript you could use window.scrollTo.

KennyTM
A: 

This is not supported directly in HTML. There is a workaround: Add the xy position as a query parameter to the URL (like ...?x=...&y=...) and add an inClick handler to the link. The handler can examine the URL (this.href) to get the position.

Aaron Digulla
A: 

Strictly speaking, you can't. But you can fake it - add the x,y as GET variables in the URL query string, like this:

http://yoursite.com/yourpage.htm?x=50&y=50&target=divID

In your javascript, you'd use something like window.scrollTo to jump to those coordinates, which you can pull from the query string.

Make sense?

matt lohkamp
PS - document.getElementByID() and pass in the target parameter from the URL too, obviously.
matt lohkamp