This is FrameJammer Version 3.2.2

What it does
Installation

How to use it
How it works
A short example

Usage notes
Site navigation
Using with templates
Using with anchors
Passing values
(You may want to print this file - there's a lot here.)


WHAT IT DOES

FrameJammed pages opened "naked" in a browser window or in the wrong frame will find their parent frameset and position themselves in the correct frame (tested with Netscape and Internet Explorer versions 3+ in Windows, NS 3+ and IE 4+ on the Mac).

Top

INSTALLATION

DREAMWEAVER 4 and higher: Use the Extension Manager.

DREAMWEAVER 3 and lower: Drop 'FrameJammer.htm' and 'FrameJammer.js' into your CONFIGURATION>COMMANDS directory. Drop 'frameJammerHelp.html' and 'fStuffer.gif' into a HELP directory in the CONFIGURATION directory (if it doesn't exist, you should create one as you'll need it to use the Help button).

Reload extensions if Dreamweaver is open.

Top

HOW TO USE IT

1. Create a frameset and name all the frames.
2. Close the frameset.
3. Open a page that should only be opened in this frameset.
4. Open FrameJammer from the COMMANDS > DABBLER menu to get this dialog box:

Frameset

Frame

When a FrameJammed page is opened directly in a browser (as from
a search engine results list), the page will find the frameset you select
above, then position itself in the frame you specify.

Anchors may also be specified. Check the Help file for details.

5. Browse to the frameset in which your page belongs and select it.
6. The names of the frames in this frameset are now listedin the bottom pulldown. Select the one you want your page to appear in.
7. Click OK, then save and close your page.

Top

HOW IT WORKS

Pages opened "naked" (in a browser directly, not in your frameset) will find their frameset and position themselves where they belong (if you follow the 'USAGE NOTES' below).

Your pages also check the name of the frame they're in to resist being "hijacked" by another site. If the frame name is wrong, the page "busts out" and positions itself in the correct frame in your frameset. This won't work if the foreign frame has the same name as yours, so you might want to avoid likely frame names such as "main" and "content". Instead, you might use names like "mainhp" or "hpcontent", using your own initials.

Top

A SHORT EXAMPLE

The image on the right is a typical frameset ('index.html'). Your frameset code looks something like this:

<FRAMESET rows="62,*">
  <FRAME name="ftop" src="topFrame.html">
  <FRAMESET cols="160,*">
     <FRAME name="findex" src="leftFrame.html">
     <FRAME name="fright" src="home.html">
  </FRAMESET>
</FRAMESET>

Now open any page on your site that you want to appear in the frameset, and select 'FrameJammer' from the COMMANDS > DABBLER menu. Initially, you see:

Frameset

Frame

When a FrameJammed page is opened directly in a browser (as from
a search engine results list), the page will find the frameset you select
above, then position itself in the frame you specify.

Anchors may also be specified. Check the Help file for details.


When you browse to and select the frameset, the display changes to:

Frameset

Frame

When a FrameJammed page is opened directly in a browser (as from
a search engine results list), the page will find the frameset you select
above, then position itself in the frame you specify.

Anchors may also be specified. Check the Help file for details

The Frame menu lists all the frames in the chosen frameset, so select 'fright' then punch the "OK" button (not shown). This writes the handler code into the frameset ('index.html') and some short FrameJammer code into 'main.html'.

You should apply FrameJammer to your default pages, too, specifying the appropriate frames (e.g., 'findex' for the 'leftFrame.html' page), as well as other pages on your site that you should appear in this frameset.

Top

USAGE NOTES:

  1. FrameJammer works with pages that are in the same directory as the frameset page, or in directories below the one containing the frameset page.
     
  2. Remove any "frame buster" code you may have in the pages, as FrameJammer will handle it for you.
     
  3. When working in a new frameset, name the frames then save all the pages and the frameset before applying FrameJammer.
     
  4. After selecting a target frameset, you are given a pick list of the frames in the set. If the page you're working on is one of the default pages for the frameset, the list consists of only the correct frame.
     
  5. If FrameJammer is already in a page, you are shown the names of the targeted frame and frameset. To change the targets, use the 'Change' button. You may also 'Remove' FrameJammer from the page.
     
  6. Double jamming doesn't work. I was able to confuse a browser by specifying that one of the default pages in frameset A' actually belonged in 'Frameset B', then trying to jam a different page into 'Frameset A'. You're not likely to design a site this way, but if you do get strange behavior (or non-behavior) check for conflicts in the frameset default pages.
     
  7. If you do want to use the same page as a default page in multiple framesets, use the same frame name in the framesets. You'll only be able to jam the page into one of the framesets, but it won't kick itself out of the others.
     
  8. Using JavaScript reserved words as frame names confuses JavaScript and can cause Infinite Reload Cycles and/or crashes. 'top', for example, is a no-no as a frame name, although it may work some of the time.
     
  9. Don't use tildes (~) or underscores (_) in your frame names.
     
  10. Do not use 'booker_' for any of your frame names. That's partly because of the underscore, but also because I've rewritten the frame name test to look for the frameBooker window so you can use both extensions in the same page (a fairly likely scenario). There was no change to the handler function in the parent frameset, so it will continue to work fine on a site with mixed pages (created with this and earlier versions of FrameJammer).
     
  11. 'Remove' will remove FrameJammer from a page, but will not touch the code handler written into the parent frameset because other pages may need it. This may be removed manually to save a few bytes.
     
  12. A user found that FrameJammed pages would not print from Netscape 4.x and that is now fixed. Earlier versions wrote a frame name test into the page like this:

    if (window.name!='<frame>')
    or
    if (window.name!='<frame>' && window.name!='booker_')

    That is now changed to:

    if (window.name!='<frame>' && window.name!='booker_'
    && !((self.innerHeight == 0) && (self.innerWidth == 0)))

    The problem was that Netscape opened a new invisible window to print the framed page, and FrameJammer kicked in because it knew it was in the wrong place. If you've jammed a lot of pages, I found that the Search-and-Replace in Dreamweaver 3 worked fine to make the changes for me.
Top

USING FRAMEJAMMER FOR SITE NAVIGATION

Building an index page for a framed site can be a problem. Assume a site structure like this:

frameSet.html
siteIndex.html
pages ----------\------ pageA.html
                 \----- pageB.html

The frameset and site index pages are in the same directory, with framed pages in a sub-directory called 'pages'. After applying FrameJammer, you could make a direct link to the pages, like

href="pages/pageB.html"

This works, but pageB.html will first start to load before going on to find frameSet.html and positioning itself in the correct frame. This is okay if it only happens once, as from a search engine link, but becomes annoying if it keeps happening. An improvement is to link to the frameset page and specify which page you want loaded ('fright' is the name of the frame for the page) like this:

href="frameSet.html?pages/pageB.html~fright

Almost there. The pageB.html doesn't show, but the frameset default page still starts loading before pageB.html replaces it. This is okay if it only happens once, as from a search engine link, but becomes annoying if it keeps happening.

To stop that, you can use FrameStuffer rather than FrameJammer. With FrameStuffer, there is no default page flash, and you provide a better user experience for navigation.

If you've already applied FrameJammer to any pages, you won't need to change them, but will need to modify your frameset. Details are in the FrameStuffer Help file.

Top

USING FRAMEJAMMER IN DREAMWEAVER TEMPLATES:

There's no simple way to use frameJammer in Dreamweaver templates. FrameJammer writes a line like this on each page to be jammed:

top.location.replace('../framesetpage.html?path/page.htm~frame');

The page being jammed and the path to it from the frameset directory ('path/page.htm') are "hard coded" so this won't work in a template. For a while, I had frameJammer write code that does work in a template:

top.location.replace('../framesetpage.html?'+location.href+'~frame');

The problem with that is that it does not work in Netscape 4.08, and I received notes about it from a number of people, so I changed it back. If you don't care about NS 4.08 surfers, you can apply FrameStuffer, then change the line as above before saving the page as a template.

NOTE: USE THIS AT YOUR OWN RISK.

If you do use the code above in a template, you also need to make a change to the FrameJammer code in your frameset page. Open the frameset page and find this line:

if (framedPage.length>1 && framedPage.indexOf("://")==-1){

Change it to read:

if (framedPage.length>1){

Now save the frameset page and close it.

NOTE: This creates a potential security hole that might allow someone to insert one of their pages into your frameset. The inserted page would then have access to information in the frameset such as cookies and variables, or could be a form that asks the visitor for data then submits it to the dastardly person inserting the page. While the visitor would have to arrive from a special link on the dastard's site, it could happen. USE AT YOUR OWN RISK.

Top

USING ANCHORS WITH FRAMEJAMMER

You can now specify an anchor in the page you're stuffing, but you need to do it manually. First apply FrameStuffer to a page. In the code FrameStuffer wrote, find the line that looks something like:

top.location.replace('index.html?thepage.html~fright');

and insert the name of your anchor like this:

top.location.replace('index.html?thepage.html@theanchor~fright');

Note that you must use the '@' rather than '#' because of a JavaScript issue. Now open the frameset, and add the section of code as shown below in red:

if (framedPage.length>1 && framedPage.indexOf("://")==-1){
   framedPage = framedPage.substring(1);
   var theSplit = framedPage.lastIndexOf('~');
   var thePage = framedPage.substring(0,theSplit);
   // insert the anchor code here if required

   if (thePage.indexOf('@') !=-1){
      re=/(\S+)@(\S+)/
      theArray = re.exec(thePage);
      thePage=theArray[1]+'#'+theArray[2];
      }

   var theFrame = framedPage.substring(theSplit+1);
   eval("top.frames["'+theFrame+'"].location.replace('"+ thePage+"')");}
   }

Top

PASSING VALUES

A user needed to pass a query string to dynamic pages being stuffed, so came up with a modification to the code in the pages (thanks, Steph). To use it, you first apply FrameJammer to a page, then add this code:

<script>
var qstring = location.search;
if (qstring.length > 1)
   qstring = qstring.substring();
</script>

And modify the line that reads something like:

top.location.replace('../framesetpage.html?path/page.asp~frame');

to include the variable that is determined above:

top.location.replace('../framesetpage.html?path/page.asp'+qstring+'~frame');

You'll have to apply it by hand, but it will do the job.

Top

As usual, use at your own risk. If you run into problems please print the Help file out, then try again. If that doesn't work, let me know and I'll see what I can do to help.

Enjoy

Hal
http://www.pawluk.com/public/