S
Spartanicus
I have a list of links using the following construct:
<a href='#artane' onclick='pos(1107,281)'>Artane</a>
The links offer additional functionality through JS. There are no actual
fragment IDs on the page, but the fragment coding allow the links to be
bookmarked. Via the window.onload event I check if a fragment ID is
present in the address, if so I need to activate the 'pos' function with
the appropriate arguments.
I'd like to loop through the links, if one has a href attribute value
that matches the window.location.hash value I'd like to activate that
link so as to avoid having to duplicate the 'pos' function's arguments
within the JS itself.
Am I going about this in an appropriate manner? If so I could use a
pointer to the JS feature that I need to activate an HTML link.
(As is probably obvious I know very little about JS)
<a href='#artane' onclick='pos(1107,281)'>Artane</a>
The links offer additional functionality through JS. There are no actual
fragment IDs on the page, but the fragment coding allow the links to be
bookmarked. Via the window.onload event I check if a fragment ID is
present in the address, if so I need to activate the 'pos' function with
the appropriate arguments.
I'd like to loop through the links, if one has a href attribute value
that matches the window.location.hash value I'd like to activate that
link so as to avoid having to duplicate the 'pos' function's arguments
within the JS itself.
Am I going about this in an appropriate manner? If so I could use a
pointer to the JS feature that I need to activate an HTML link.
(As is probably obvious I know very little about JS)