That's a proof of concept.
A generic location chop is needed, as noted.


On Dec 18, 2009, at 3:29 PM, Roger Hui <[email protected]> wrote:

Can it work for an arbitrary anchor?  e.g. If the URL is
http://www.jsoftware.com/papers/APLEvol.htm#biokei
can it jump to biokei on load?  (And jump to ref if
the URL is ...#ref?)

Sounds like it's time I learn more about Javascript.



----- Original Message -----
From: Oleg Kobchenko <[email protected]>
Date: Friday, December 18, 2009 12:07
Subject: Re: [Jchat] HTML -- anchors and frames
To: Chat forum <[email protected]>

From: Roger Hui <[email protected]>


Does anyone know how to specify as an URL a jump 
to a particular anchor in an HTML page which uses frames, 
or know definitively that it can not be done?

For example, the anchor for the References section in 
"The Evolution of APL" is "ref".  If that page did not
use frame, I could say:
http://www.jsoftware.com/papers/APLEvol.htm#ref
But that page does use frames, so how do I do it?
Or is it not possible?

It's javascript-only. You need to append the hash part of 
Frameset 
URL to src of the target frame.

As an example, use this URL: 
   
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_frame_jump
and paste the code below and click [Edit and Click Me]

============================================================================
<html>

<script>
function jump() {
  var f = document.getElementById("main");
  f.src += 
"#ref";                       // chop up document.location instead
}
</script>

<frameset cols="20%,80%" onload="jump()">

 <frame id=left name=left 
src="http://www.jsoftware.com/papers/APLEvolTOC.htm";> <frame id=main name=main 
src="http://www.jsoftware.com/papers/APLEvol1.htm";>

</frameset>

</html>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm



      
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to