SCEC Education Module Regional Seismicity

How to Link to Specific Pages in this Module

Without Losing the Navigation Frame

This web site utilizes frames as a way to provide the user with a "navigation bar" that is always available. (Frames also allow some of the interactive features to operate.) Because of this setup, people have been unable to link to a specific page of this educational module without losing the navigation frame in the process.

To solve this problem, we have created a solution using JavaScript that can be added to any page that links to our module. This JavaScript allows your links to open up a specific pages of the module within a new window, enclosed in the proper frameset.

A description of how to do this follows. First, you will need to insert the following code within the <head> tags of your own page:

<script language="JavaScript">

  var op;

  function openPage(op) {
    newModule = window.open("http://www.data.scec.org/Module/rmodule.html", "newmod");
    placer = "http://www.data.scec.org/Module/" + op + ".html";
    setTimeout("newModule.parent.frames[1].location = placer", 2000);
  }

</script>

To link to a particular page within this module, you need to know the filename of that page. This can be done by clicking and holding down the mouse button inside the frame with the page you want, until a pull-down menu comes up, with an option that says something like "Open Frame in a New Window." Select that option. When the new window opens, check the "Location" bar at the top. It should give you the URL of that particular page, which will look something like this:

http://www.data.scec.org/Module/xxxxxxxx.html

If you try this now (on this page), for example, you should see:
http://www.data.scec.org/Module/how2link.html

The piece of this URL you need to remember, highlight and copy on screen, or write down is the "xxxxxxxx" part after "/Module/" and before the ".html" of the filename.

Wherever you would like to link to a specific page of the module from your own page, instead of simply typing

<a href="xxxxxxxx.html">

in the opening part of the anchor tag, type in the following code, which tells JavaScript (as written above) to execute the script function openPage, which will bring up the page xxxxxxxx.html in a new window and within the module navigation frames:
<a href="javascript:openPage('xxxxxxxx')">

In our example using this page, the opening anchor tag would therefore look like this:
<a href="javascript:openPage('how2link')">

And that's how you can link directly to a module page and retain the navigation frames!

Additional Resources: