Return to 'About this site'Home

JAVASCRIPT RELOADING IN NETSCAPE

Netscape Navigator fails to aply style from external or local stylesheets when the window is resized: on the Macintosh with Netscape 4.5 this happens only with documents in frames: but I believe that on Windows (which I can't check) it happens with any document.

In order to get round this I have used JavaScript - I didn't write this, I might add, but picked it up from WebReview. It is applied in the Head section, and looks like this:

<SCRIPT LANGUAGE="JavaScript1.2"><!-- Hide from old browsers
NS4 = document.layers;
	if (NS4) {
		origWidth = innerWidth;
		origHeight = innerHeight;
		}
		function reDo() {
			if (innerWidth != origWidth || innerHeight != origHeight)
			location.reload();
			}
			if(NS4) onresize = reDo;
// Stop hiding from old browsers --></SCRIPT>

The script forces a reload (only in Netscape) but unfortunately this takes the document back to the top of the page. 

Where frames are concerned, I modified the script as follows:

<SCRIPT LANGUAGE="JavaScript1.2"><!-- Hide from old browsers
	NS4 = document.layers;
	if (NS4) {
		origWidth = innerWidth;
		origHeight = innerHeight;
		}
		function reDo() {
			if (innerWidth != origWidth || innerHeight != origHeight)
			slsh = (parent.framename.document.URL.lastIndexOf('/'))			
			frsc = (parent.framename.document.URL.substring(slsh+1))
			rld = "x" + frsc
			location.href = rld
				}
				if (NS4) onresize = reDo;
// Stop hiding from old browsers --></SCRIPT>

- where 'slsh', 'frsc' and 'rld' are temporary variables which you can call anything, and'framename' is the name of the frame containing the document which is losing its styles. You have to make a duplicate of the original frameset, but giving it the name of the document in the frame preceded by an 'x', for each page loaded into the frameset, and it has to be in the same directory. Again, this takes the document back to the top of the page, and of course the reloading takes time: but it does maintain your styling, and in any case only happens if your visitor resizes the window.