Log in

View Full Version : Firefox Problem



hamfast
02-29-2008, 03:51 PM
Hello

Firefox is giving me some grief in that a website that shows fine in IE shows only as HTML in FF.

I've changed hosts still the same outcome. I've checked my code. Still the same. I've even got rid of all my code and stuck in a fresh new page consisting of just the most basic few lines of HTML but still the same.

What causes this?

THanks
H

boogyman
02-29-2008, 04:08 PM
Everything eventually gets translated / into html to be rendered on the screen, so can you please be more specific about what isn't displaying that should be displaying.

I am going to make an assumption and say that you are having difficulties with javascript?? possibly? and my answer to that is you have errors on your code that are actually being errored in Fx where IE doesn't error what it should.

Post the url to the problematic code so we can better help you troubleshoot your problems

hamfast
02-29-2008, 04:23 PM
Hello Boogeyman - thanks for the response

No it's not javascript related in anyway.

I've got a page that reads nothing more than this:

<html>
<head>
<title>Title of page</title>
</head>
<body>
This is my first homepage. <b>This text is bold</b>
</body>
</html>

There is nothing else. It's not got any JS, PHP or CSS. And that's exactly how it shows in FF whereas in IE it's displays correctly.

jscheuer1
02-29-2008, 04:34 PM
I think that you mean it shows as HTML in IE and as the raw source code in FF. And I am assuming the page displays OK in FF when run locally, right?

If so, try a valid page, like this (call it test.htm or something with the .htm or .html extension):


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Title of page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>
<body>
<div>
This is my first homepage. <b>This text is bold</b>
</div>
</body>
</html>

If that still doesn't work in FF, then the server needs to be reconfigured.

boogyman
02-29-2008, 04:35 PM
so it is rendering the code, and not parsing / processing the html code?

the only reason any page should be parsing computer code is if you escape the less than and/or greater than signs, or if you use the depreciated <pre> tag.

if that is all you have in your file, then you have something corrupt with your version of Fx.

hamfast
02-29-2008, 04:42 PM
Rawcode in FF and HTML in IE - yep, that's what I meant sorry for the confusion.

hamfast
02-29-2008, 04:47 PM
I'm chasing this up with my new host who've advised that the nameservers hadn't been transferred from my old host (who didn't want to help with this problem whatsoever) to my new host. Is this likely to be the cause of the problem?

It wouldn't explain why it didn't work with the original hosts but I don't care if I get the right result...

jscheuer1
02-29-2008, 05:04 PM
It could, the basic problem is that the server is serving the code as plain text. If it doesn't, the meta content tag (from my example) should take care of that, but if not, the host should be configured to send the page properly.

You are using a .htm or .html extension on the page, right?

coothead
03-01-2008, 11:53 AM
Hi there boogyman,

or if you use the deprecated <pre> tag.
I think that you may be confusing the pre element with the xmp element. ;)

The following elements are obsolete: LISTING, PLAINTEXT, and XMP. For all of them, authors should use the PRE element instead.
Source:-

http://www.w3.org/TR/html401/appendix/changes.html#h-A.3.1.3

coothead

BLiZZaRD
03-01-2008, 06:10 PM
depreciated and obsolete are two different things. Also note we are in HTML 4.1, and your link points to 4.0. Strict coding makes pre tag worthless, and the depreciated "transitional" DOCTYPE will still use it. YAY Quirks mode!

jscheuer1
03-01-2008, 06:22 PM
Geez boogyman, there is nothing wrong with pre. It will not override and literally show the tags contained within it, but will change their meaning in some cases. None of what you mention will display computer code though. It won't even display the HTML source code.

For a page to be served as plain text, the server must do so. Some browsers may override this if the file has an extension it associates with HTML, but they technically should not.

coothead
03-01-2008, 07:45 PM
Hi there BLiZZaRD,

I do not want to make a major issue over this, but the pre element is definitely not deprecated.
Of course, it may very well be depreciated but then, I am not sure in what sense you are applying the word. ;)

coothead

jscheuer1
03-01-2008, 08:19 PM
Of course, it may very well be depreciated . . .
coothead

It begins to lose value the moment you drive it off the lot. :)

hamfast
03-04-2008, 09:07 AM
Alright Fellers

Didn't mean to cause any grief.

I'm waiting for the nameservers to be changed to correct settings then I'll implement the changes recommened above. Thanks for the help.

Strikes me that nothing is definitive with HTML et al.

Thanks H

hamfast
03-04-2008, 09:55 AM
I couldn't resist but mess around prior to nameserver changes and I've changed my file names on all pages, not just index, from .php to .html (which John mentioned this earlier in the thread) and suddenly the problem's fixed - the pages are showing in FF when they weren't previously.

Why is this? I haven't had to change pages away from pagename.php before on the very basic websites I've put together before. Or is that too big/stupid a question to ask?

jscheuer1
03-04-2008, 01:09 PM
This has nothing to do with HTML being vague (which, in quirks mode, it is - but there are standards you can choose to follow and enforce for your documents). It is a problem with proper server configuration.

FF is fairly strict (more so than IE) when interpreting what the server tells it the page's mime type is. The server decides what mime type to tell the browsers that the file is based upon the file's extension and that is configurable in various ways, as to which extensions get served as which mime types, on the server side.

The:



<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Title of page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>
<body>
<div>
This is my first homepage. <b>This text is bold</b>
</div>
</body>
</html>

meta tag used in a valid document can often override this. With PHP, you can often use some sort of PHP directive at the very top of the page to declare its mime type to the server:


<?php
Header("content-type: text/html");
?>

Now, if the server isn't PHP enabled, this will not help, and the pages should all have .htm or .html extensions. If it is PHP enabled, and the pages with the .php extension are being served as text, the server's configuration should be changed to remedy this.

hamfast
03-04-2008, 02:19 PM
John

Think I followed most of that. And I thank you for your time. It's a lesson learned for present and future reference.

Thanks
H