Freak JavaScript problem

Bert Coenen Bert.Coenen at law.kuleuven.ac.be
Fri Aug 4 07:57:34 EDT 2000


I have this weird problem: I added some code to a page -that is only meant to 
open as a frame in another page- to ensure that it doesn't open in its own 
window. 

this is the code:

    var strParent = "index.html";
    if (top.location.href.indexOf(strParent) == -1) {
    top.location.replace(strParent);
    }	

The code works fine but I have two problems.
one: the page does not stop loading (even when I click the stop button), this 
isn't the end of the world, in fact I have already had this problem with other 
pages on the internet.
two: I cannot print the page in Netscape (IE works just fine), I get a message 
telling me that there are no pages to print
Without the code: no problems whatsoever.

I am working on a win98 machine with NS 4.73 and IE 5.

And while I'm here, two more questions: 
one: I'm using tables with a fixed width and I'd like to position one table 
directly beneath another table, why is it that NS and IE display the second 
table next to the first instead of beneath it? What I have to do now is insert 
lots of <br> to move the second table down, is there a cleaner way to do this.
two: I have already posted this but some of you may have missed this one: one 
of the web-databases that we offer on the computers in our library causes the 
left mouse button to stop working in Netscape; does anyone know of a solution 
to this problem?


More information about the Web4lib mailing list