Anni: Finding Parents for Orphaned Pages

when i insert the javascript code for "Finding Parents for Orphaned Pages", i always get javascript errors. here an example: http://www.jarbidgeadventures.com
what am i doing wrong?

i took the code from:
http://www.jwweb.com/20011013.html

thanks,
anni

  1. Hi Anni,

    No wonder! You named your frame "mainFrame" in the frameset, ...

    <frameset rows="119,*,32" onLoad="fillFrame();" cols="*" frameborder="NO" border="0" framespacing="0">
      <frame src="top.html" name="topFrame" scrolling="NO" noresize >
      <frameset cols="153,*" frameborder="NO" border="0" framespacing="0">
        <frame src="nav.html" name="leftFrame" scrolling="YES" noresize>
        <frame src="main.html" src="javascript:parent.blank" name="mainFrame">
    ______________________________________________________________^^^^^^^^^^
      </frameset>
      <frame src="bottom.html">

    ... but on the other hand you call it "main" in the function.

    function fillFrame() {
        parent.main.location.href = pageURL;
             //^^^^
      }

    Simply give it the same name in both cases and your script will work without errors.

    Gruß Gernot

  2. Tag Anni.

    when i insert the javascript code for "Finding Parents for Orphaned Pages", i always get javascript errors. here an example: http://www.jarbidgeadventures.com

    The error is: »parent.main has no properties at line 18«. Line 18 is:
      parent.main.location.href = pageURL;

    what am i doing wrong?

    The name-attribute of your main frame has the value »mainFrame«, not »main« :)

    [dsf 3.6]
    Siechfred

    --
    »Sie kochten heimlich mit Wasser und tranken öffentlich Wein.«
  3. Hi, Anni!

    when i insert the javascript code for "Finding Parents for Orphaned Pages", i always get javascript errors.

    what errors exactly?

    i took the code from:
    http://www.jwweb.com/20011013.html

    thats, why you should know some basics about html, javascript, e.t.c. , as written above the forum. ;-)

    compare the names of the frameset in the example to your own framenames.
    the script calls "parent.main.location.href = pageURL;", but you have no frame with this name (main) in your frameset.
    adjust the script to the right framename and
    set the variable "pageURL" on top of the script to the first page, witch should be displayed. im sure, you have no file, named "DEFAULTPAGE.HTML" on this server, right?

    freundl. Grüsse aus Berlin, Raik

  4. thank you very much guys!
    it works now :-)

    when i insert the javascript code for "Finding Parents for Orphaned Pages", i always get javascript errors. here an example: http://www.jarbidgeadventures.com
    what am i doing wrong?

    i took the code from:
    http://www.jwweb.com/20011013.html

    thanks,
    anni