[thelist] javascript print problem in frames

Jeff Dale slumpy at home.com
Tue Apr 10 13:57:16 CDT 2001

I need some help with printing a frame.  I have used a script which
forces all the content pages in my site into its respective frameset
page using the code below:

if (top.location == self.location) {
   top.location.href = "framsetPage.html?contentframe.html"

the problem I run into is that in Navigator 4 (of course) when you click
the print button it returns an error "no pages to print"  When you take
this javascript off the content pages, it seems to print ok.  Is there
an addition I could add to this script that would allow me to print the
content pages without error?  Or is there some other way I could do what
i need to do?  It seems to be processing the script when you go to
print, then it loads the frameset again so to speak, causing the error,
though thats just speculation on my part.

I should say my knowledge of javascript is limited at best....

Any help would be much appreciated.

the script that is on the frameset page is below:

linkURL = "contentMain.html"
 if (parent.document.URL) {
  callingURL = parent.document.URL
  if (callingURL.indexOf('?') != -1) {
   linkURL =
 document.writeln('<frameset rows="86,*,69" frameborder="NO" border="0"
framespacing="0" cols="*">')
 document.writeln('<frame name="topNav" src="Top.html" noresize
marginwidth="0" marginheight="0" frameborder="NO">')
 document.writeln('<frame src="' + linkURL + '" name="content" noresize
frameborder="NO" marginwidth="0" marginheight="0">')
 document.writeln('<frame name="botnav" src="Bottom.html"
marginheight="0" noresize frameborder="NO" marginwidth="0">')

thanks for the help
Platinum Resources Ltd.

More information about the thelist mailing list