New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

Opening Local HTML files - render HTML (not display as text)


Post Reply New Thread Subscribe

 
Thread Tools
Gator626

 
Member Since: Nov 01, 2009
Posts: 4
Gator626 is on a distinguished road

Gator626 is offline
Hello everyone,

I am somewhat new with web development on a mac, and am running into some issues trying to test my HTML. I create an HTML file and save it to my local file system. When I open it in a web browser (Firefox and Safari), the page displays the literal HTML text instead of rendering the HTML into a web page like it should.

Is there a setting somewhere on the Mac OS that can overturn this?

Thanks.
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,756
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
You should have no problem with opening html files in your web browser. Are you saving them with the html extension (.html or .htm)?

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks
Gator626

 
Member Since: Nov 01, 2009
Posts: 4
Gator626 is on a distinguished road

Gator626 is offline
Thank you for the quick response.

Yes, the file had a .html extension. The file info displays as "HTML Document". However, even the preview just displays the literal HTML text. Very frustrating, considering this is such a trivial issue on a PC. Is there a setting in the Apache Web Server on OS X that is running a style transform on local HTML documents to cause the literal text to be displayed?

Another thing to add: when I view the page source, it appears additional HTML has been added so that the page will display the literal HTML. Makes zero sense.

Pardon my frustrations.
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,638
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
I don't believe the Preview application does HTML rendering. Now, why the browsers are not rendering html? I've no idea... generally when I've seen that it was a code issue...


edit: are you browsing this through the filesystem or through the webserver?

mike
This machine kills fascists
Got # ? phear the command line!
QUOTE Thanks
Gator626

 
Member Since: Nov 01, 2009
Posts: 4
Gator626 is on a distinguished road

Gator626 is offline
Quote:
Originally Posted by Dysfunction View Post
I don't believe the Preview application does HTML rendering. Now, why the browsers are not rendering html? I've no idea... generally when I've seen that it was a code issue
I tried it with a very basic HTML file
<html>
<head />
<body>abcd</body>
</html>

And it does the exact same thing (displays tags & text as a literal text file). Make little sense to me as well, and I doubt it is browser specific since Safari and Firefox are both doing it. Almost tempted to chalk up the loss and scrap the mac from a web development standpoint, because this is way too trivial to be spending a lot of time trying to troubleshoot.
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,638
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
I just copied that into textedit and saved it as html... it did the same as you described... so I did a cat -v

Code:
mikeMbp:Desktop mike$ cat -v Untitled.html 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="Content-Style-Type" content="text/css">
  <title></title>
  <meta name="Author" content="Mike">
  <meta name="Copyright" content="Mike">
  <meta name="Generator" content="Cocoa HTML Writer">
  <meta name="CocoaVersion" content="1038.11">
  <style type="text/css">
    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Times}
  </style>
</head>
<body>
<p class="p1">&lt;html&gt;</p>
<p class="p1">&lt;head /&gt;</p>
<p class="p1">&lt;body&gt;abcd&lt;/body&gt;</p>
<p class="p1">&lt;/html&gt;</p>
</body>
</html>
mikeMbp:
So i edited out the cr@p in vi.

Code:
mikeMbp:Desktop mike$ cat -v Untitled.html 

<html>
<head>
<title></title>
</head>
<body>
abcd
</body>
</html>
and it works. It's not the mac, it's textedit (which I think sucks anyway) try textwrangler, it's LEAPS and BOUNDS better as an editor.

Alternately you can (in textedit) go to Format > Make Plain Text


I hate rich text biased editors.

mike
This machine kills fascists
Got # ? phear the command line!
QUOTE Thanks
Gator626

 
Member Since: Nov 01, 2009
Posts: 4
Gator626 is on a distinguished road

Gator626 is offline
Thanks for the suggestion! You are right -- it probably is the text editor. I have been using komodo edit, but haven't really found it very intuitive. I will take a look at text wrangler.

Thanks again!
QUOTE Thanks

Post Reply New Thread Subscribe


« Software Update | Access denied folder Via PC > iMac network »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Safari 4: Possible to display text labels on buttons? cwa107 OS X - Apps and Games 10 06-11-2009 05:12 PM
Artwork, iTunes and icons for audio files in Finder Theophil iOS and Apps 2 11-27-2008 09:55 AM
How many Apple techs does it take to fix a MacBook? dougnewman Apple Notebooks 8 11-09-2008 01:18 PM
which external display for a macbook for text? richrat Other Hardware and Peripherals 3 05-26-2008 02:58 AM
Display Issue kako OS X - Operating System 0 06-29-2006 04:16 AM

All times are GMT -4. The time now is 01:28 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?