Gossamer Forum
Home : General : Internet Technologies :

Browsers

(Page 1 of 2)
> >
Quote Reply
Browsers
I've managed to get a new site I'm working on displaying properly in the following browsers:

IE 4
IE 5
IE 6
Opera 6.01
Mozilla 0.9.9

but it screws up the top logo area in:

Netscape 4
Netscape 4.7

I'm yet to test it in Netscape 6.2.

Is there anything I can do to detect those two browsers (Netscape 4 and Netscape 4.7) and replace the image with text as it does look fine when I do that?

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------
Quote Reply
Re: [Philip_Clark] Browsers In reply to
can't you run a bit of javascript using a main page to detect the browser type and either direct folks to better looking pages? Maybe it's now possible to detect each page to do something similar ....

hmmm ... have your problem areas set as SSI or php and use javascript to detect browser and then to choose which header area to show.

sorry I can't program therefore the lack of examples Frown

openoffice + gimp + sketch ... Smile
Quote Reply
Re: [QooQ] Browsers In reply to
Quote:
hmmm ... have your problem areas set as SSI or php and use javascript to detect browser and then to choose which header area to show.

That sounds like a good idea - just a question of trying to figure out how to do it now Crazy.

P.S - I got the first proper thread in the Internet Technologies forum! Na Na Na! Wink

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------
Quote Reply
Re: [Philip_Clark] Browsers In reply to
Like I mentioned in your other similar Thread, you could use javascript to print the appropriate "header" included file.

SSI - SHTML example:

Quote:

// Checks Browser Type, Version and OS
// Used for displaying appropriate Header File

function getBrowser() {
if (navigator.appName.indexOf("Netscape") != -1)
if(navigator.appVersion.indexOf("4") != -1)
return 1
else
return 0;
}

// Print appropriate included header file

if (getBrowser() ==0) document.write("<!--#include virtual='nonnetscapeheader.inc'-->");
if (getBrowser() ==1) document.write("<!--#include virtual='netscapeheader.inc'-->");


These codes would be placed in a js file called something like checkbrowser.js.

Then reference the js file in the <head></head> section of your pages or main "header" file, like the following:

Quote:

<script language="Javascript" type="text/javascript" src="checkbrowser.js"></script>


Alternatively and probably more reliable, would be to code your HTML in HTML 3.2, which is backward and forward compatible between lower and higher versions of browsers.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Philip_Clark] Browsers In reply to
No need to use a sledgehammer to crack a nut. The solution is simple. Netscape 4x don't like 'Cell spacing' in a table over a colored table or background, as this will show the background colors through the 'spacing'

The solution is to compensate with 'cellpadding' instead. Try:

<table width="100%" bgcolor="#9ACD32" cellspacing="0" cellpadding="3" border="0">

~ ERASER


Free JavaScripts @ Insight Eye
Quote Reply
Re: [Eraser] Browsers In reply to
Thanks for the two solutions guys - this really is a great forum! Cool

I'll give it a try and will let you know how I get on.

Cheers.

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------
Quote Reply
Re: [Heckler] Browsers In reply to
Quote:
// Print appropriate included header file

if (getBrowser() ==0) document.write("<!--#include virtual='nonnetscapeheader.inc'-->");
if (getBrowser() ==1) document.write("<!--#include virtual='netscapeheader.inc'-->");

Would I just put normal html code in those two *.inc files would I Eliot?

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------
Quote Reply
Re: [Philip_Clark] Browsers In reply to
Duh..yea.

Haven't you seen SSI calls in web pages before??
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Heckler] Browsers In reply to
Why of course but I was a little confused why it has a *.inc extension.

Just thought I'd check.

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------
Quote Reply
Re: [Philip_Clark] Browsers In reply to
*.inc files are really nice to use since they will parse like .txt and any other ascii based file, but they are useful because you can identify them as included files rather than plain .txt or .html files.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Heckler] Browsers In reply to
I get the following error:

Quote:
Line: 18
Char: 65
Error: Unterminated string constant

with this line:

Code:
if (getBrowser() ==0) document.write("<!--#include virtual='nonnetscapeheader.inc'-->");

Any ideas what the problem is?

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------

Last edited by:

Philip_Clark: Apr 14, 2002, 8:06 PM
Quote Reply
Re: [Philip_Clark] Browsers In reply to
Probably have to escape the <!-- and --> codes.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Heckler] Browsers In reply to
Crazy - how can I do that?

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------
Quote Reply
Re: [Philip_Clark] Browsers In reply to
Hmm thats strange. I've just tried the code with IE6 and NS6 and it doesn't seem to do anything but I don't get a JS error either.
Quote Reply
Re: [Philip_Clark] Browsers In reply to
Hi,

The problem is:

Quote:
if (getBrowser() ==0) document.write("<!--#include virtual='nonnetscapeheader.inc'-->");


will get turned into:

Quote:
if (getBrowser() ==0) document.write("contents of your file here");


So if nonnetscapeheader.inc contains anything like a ", or other characters javascript doesn't like, you will get a javascript error.

If you wanted to go this route, you'd need to javascript escape the contents of the .inc files.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Browsers In reply to
Will using *.shtml files solve this problem?

What do I do to javascript escape the contents of the *.inc files?

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------

Last edited by:

Philip_Clark: Apr 15, 2002, 5:41 PM
Quote Reply
Re: [Alex] Browsers In reply to
Quote:
If you wanted to go this route, you'd need to javascript escape the contents of the .inc files.


Can someone tell me how to escape the contents of the .inc files please?

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------
Quote Reply
Re: [Philip_Clark] Browsers In reply to
Anyone - please Unsure

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------
Quote Reply
Re: [Philip_Clark] Browsers In reply to
I've been playing around and have this code:

Code:
<script language="javascript">

var browserName = navigator.appName

if (browserName == "Netscape")
{
document.write ('')
}
else
{
document.write ('"<img src=\"images/seperator.gif\" alt=\"seperator\">"')
}
</script>
It isn't printing the image though - just "" Unsure

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------
Quote Reply
Re: [Philip_Clark] Browsers In reply to
Yes Cool

Have it done with:

Code:

<script language="javascript">

var browserName = navigator.appName

if (browserName == "Netscape") {
document.write ('')
}else{
document.write ("<img src=\"images/seperator.gif\" alt=\"seperator\">")
}
</script>

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------
Quote Reply
Re: [Philip_Clark] Browsers In reply to
Site now works in

IE 4
IE 5
IE 6
Opera 6.01
Mozilla 0.9.9
Netscape 4.7
Netscape 6.2

but still screws up in:

Netscape 4

I don't think I need to worry about this. What does everyone else think?

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------

Last edited by:

Philip_Clark: Apr 16, 2002, 7:30 PM
Quote Reply
Re: [Philip_Clark] Browsers In reply to
Netscape 4 is ancient, and sometimes isn't worth your time and effort to write for. However, you should at least put up an honest fight to have it look right and function.

On a site design Paul wrote for me, he used CSS heavily. While the design looked great in IE 4.x and later, and Mozilla/Netscape6, older Netscapes didn't like it at all. I spent a whole day rewriting the design to not use CSS and it now looks exactly the same in IE4+ and NS4+ and validates 100%.

--Philip
Links 2.0 moderator
Quote Reply
Re: [sponge] Browsers In reply to
Yeah, I'll definately give it a go at getting it to work in Netscape 4 but I'm not going to worry about it if I can't. I must cover at least 98% of people with my browser options there.

Damn - doesn't validate now with that Javascript:

Quote:
Line 30, column 32:
... document.write ("<img src=\"images/seperator.gif\" alt ...
^
Error: an attribute value must be quoted if it contains any character other than letters (A-Za-z), digits, hyphens, and periods; use quotes if in doubt

Line 30, column 35:
... g src=\"images/seperator.gif\" alt=\"seperator\">")
^
Error: an attribute value must be quoted if it contains any character other than letters (A-Za-z), digits, hyphens, and periods; use quotes if in doubt

Line 30, column 50:
... img src=\"images/seperator.gif\" alt=\"seperator\">")
^
Error: element "img" not allowed here; check which elements this element may be contained within

Here we go again Pirate

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------
Quote Reply
Re: [Philip_Clark] Browsers In reply to
Hehe NS4.0 ...ah what a great browser...I recommend everyone use it :)

Funny you should mention it though....yesterday I got a pm regarding Netscape 4 and some templates I'd done (that get distributed with Links SQL...nah nah!!)...hehe anyway, I'm still waiting to hear back if my solution worked.

Last edited by:

Paul: Apr 17, 2002, 2:39 AM
Quote Reply
Re: [Paul] Browsers In reply to
I've spent hours getting the damn thing working in so many different browers plus validating. Getting extremely annoying Crazy

Quote:


Line 30, column 32:
... document.write ("<img src=\"images/seperator.gif\" alt ...
^
Error: an attribute value must be quoted if it contains any character other than letters (A-Za-z), digits, hyphens, and periods; use quotes if in doubt


Does anyone know what the problem is here and how to fix it? I am quoting the things I thought Crazy

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------
> >