Page 1 of 1 [ 15 posts ] 

JakeGrover
Sea Gull
Sea Gull

User avatar

Joined: 21 May 2010
Age: 28
Gender: Male
Posts: 221
Location: Vermont, USA

22 Jul 2010, 1:53 pm

I'm trying to test out an HTML file I wrote locally on my Hard Drive. When I open it up in Firefox, it just shows the HTML I wrote, not the actual translation into a web page. The file format is .html Does anyone know why this is happening? Any help would be appreciated.



BNineFounder
Tufted Titmouse
Tufted Titmouse

User avatar

Joined: 5 Jul 2010
Age: 56
Gender: Male
Posts: 39
Location: Big Owie, California USA

22 Jul 2010, 2:43 pm

What type of computer are you using? What operating system? If the MIME type isn't set right in your OS, it will do this.



computerlove
Veteran
Veteran

User avatar

Joined: 10 Jul 2006
Age: 125
Gender: Male
Posts: 5,791

22 Jul 2010, 4:34 pm

if you open it in Notepad or Textedit, does it look like this:

Code:
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
   <HEAD>
      <TITLE>My first HTML document</TITLE>
   </HEAD>
   <BODY>
      <P>Hello world!
   </BODY>
</HTML>


btw, what did you use to create the file? do you have a colored syntax editor? (like Textwrangler (osx) or Notepad+ (win)
(to let you better see coding/errors)


_________________
One of God's own prototypes. Some kind of high powered mutant never even considered for mass production. Too weird to live, and too rare to die.


Jookia
Velociraptor
Velociraptor

User avatar

Joined: 7 Jan 2007
Age: 30
Gender: Male
Posts: 410

22 Jul 2010, 4:52 pm

It's best to use XHMTL because it enforces strict typing and proper syntax and closed tags.



Last edited by Jookia on 22 Jul 2010, 4:53 pm, edited 1 time in total.

flapjack
Emu Egg
Emu Egg

User avatar

Joined: 18 Jul 2010
Age: 36
Gender: Male
Posts: 2

22 Jul 2010, 4:52 pm

It might be saved as .html.txt. Most OSes will "helpfully" hide the file extension from you by default.



Jookia
Velociraptor
Velociraptor

User avatar

Joined: 7 Jan 2007
Age: 30
Gender: Male
Posts: 410

22 Jul 2010, 4:54 pm

flapjack wrote:
It might be saved as .html.txt. Most OSes will "helpfully" hide the file extension from you by default.


You mean Macs and Windows? All the other OSes don't. It's hardly most.



flapjack
Emu Egg
Emu Egg

User avatar

Joined: 18 Jul 2010
Age: 36
Gender: Male
Posts: 2

22 Jul 2010, 5:05 pm

Jookia wrote:
You mean Macs and Windows? All the other OSes don't. It's hardly most.


Hah, I agree. Didn't think that one through. Most (desktop/laptop/personal) computers are running either Mac OS or Windows though. Perhaps that's not true here. Using Ubuntu with XFCE myself. I don't want to hijack the thread!



BNineFounder
Tufted Titmouse
Tufted Titmouse

User avatar

Joined: 5 Jul 2010
Age: 56
Gender: Male
Posts: 39
Location: Big Owie, California USA

22 Jul 2010, 5:20 pm

Speaking of that, it would be nice if these OS's that *do* hide the extension by default had an option during setup such as:

[ ] I'm not stupid, show me file extensions!



BNineFounder
Tufted Titmouse
Tufted Titmouse

User avatar

Joined: 5 Jul 2010
Age: 56
Gender: Male
Posts: 39
Location: Big Owie, California USA

22 Jul 2010, 5:28 pm

BNineFounder wrote:
[ ] I'm not stupid, show me file extensions!


Maybe that's a bit harsh. It should say:

[ ] I'm an advanced user, please enable file extensions, disable 'hand-holding' prompts, etc.



Jookia
Velociraptor
Velociraptor

User avatar

Joined: 7 Jan 2007
Age: 30
Gender: Male
Posts: 410

22 Jul 2010, 6:13 pm

I dunno 'bout you guys, but I enjoy having to enable them in the middle of something. I also enjoy Windows assuming I'm disabled and need to use sticky keys when I play games.



JakeGrover
Sea Gull
Sea Gull

User avatar

Joined: 21 May 2010
Age: 28
Gender: Male
Posts: 221
Location: Vermont, USA

22 Jul 2010, 8:12 pm

Quote:
What type of computer are you using? What operating system? If the MIME type isn't set right in your OS, it will do this.


I'm using a Mac Mini. It's running OS 10.6.3.



JakeGrover
Sea Gull
Sea Gull

User avatar

Joined: 21 May 2010
Age: 28
Gender: Male
Posts: 221
Location: Vermont, USA

22 Jul 2010, 8:22 pm

What does the Doctype do? I don't see that in my examples in the book.



computerlove
Veteran
Veteran

User avatar

Joined: 10 Jul 2006
Age: 125
Gender: Male
Posts: 5,791

22 Jul 2010, 9:57 pm

JakeGrover wrote:
Quote:
What type of computer are you using? What operating system? If the MIME type isn't set right in your OS, it will do this.


I'm using a Mac Mini. It's running OS 10.6.3.
hm, sounds like it was saved as .html.txt
to fix it: select the file, right click > select Get Info
(or press Cmd+I),
then put the correct .html extension.

You can also show file extensions:
Globally:
Finder > preferences > Advanced > check Show file extensions

File:
In the same Get Info screen, uncheck Hide file extension


_________________
One of God's own prototypes. Some kind of high powered mutant never even considered for mass production. Too weird to live, and too rare to die.


curlyfry
Veteran
Veteran

User avatar

Joined: 13 Jun 2010
Age: 57
Gender: Female
Posts: 1,502
Location: Latitude : 45.373. Longitude : -84.955

23 Jul 2010, 1:58 pm

Quote:
What does the Doctype do? I don't see that in my examples in the book.


Doctype explained here
W3school.com

What program did you write the html? I used text edit and iweb but some things didn't translate exactly once I uploaded them. I have more fun using an editor and pasting code. I'm new at it and I use a simple editor so I can see the results in preview mode.

This is what I have been using - freeware
STK Weblite

This is a new one I am sampling - shareware
Taco



BNineFounder
Tufted Titmouse
Tufted Titmouse

User avatar

Joined: 5 Jul 2010
Age: 56
Gender: Male
Posts: 39
Location: Big Owie, California USA

23 Jul 2010, 5:55 pm

Text Wrangler is pretty good for OS X too. It's not as good as its pay-for brother BareBones Editor, but it's nice.