Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Standard extension for a file containing an html fragment?

Posted on 2004-10-05
6
Medium Priority
?
1,269 Views
Last Modified: 2013-11-19
In other words, what do you call a file that has HTML tags in it, but only the tags that would normally appear between <BODY and </BODY. It doesn't have the <HTML <HEAD or <BODY tags?

I was thinking .INC but that is so overused and I would like that to be reserved for ASP code includes. .WAP is almost... .TXT isn't enough.

I spent about 15 minutes searching on the net and on ee specifically, but good keywords seem to be hard to come by: "html fragment" "without <head" "without <html" "html without extension" all came to nothing.

The answer will hopefully allow some sort of functionality in terms of being recognizable (e.g. starts with .H) and official (Microsoft, rfc, netscape, etc... said so).
0
Comment
Question by:JamesNewton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
6 Comments
 
LVL 11

Expert Comment

by:neester
ID: 12232937
I believe .htm is fine.
There are no "real" standards that I know of...
You could use .tpl (template)....
I would stick with .htm (as opposed to .html) - just so you can see its different, but you can also load the fragment in the browser indivicually without having a forced download (if you use .tpl - most browsers will come up with a download dialogue)...
0
 
LVL 5

Assisted Solution

by:cristy56
cristy56 earned 1000 total points
ID: 12233616
You can still name it as .htm , there is no problem with that.

I have tried many times with htm files where there is no <head><body> tag etc, and it can just be a plain text file with a few tags like <font color=xxx> etc and it still works without showing up errors. So I guess u can still name it as .htm


Regards,
Cristy
0
 
LVL 11

Accepted Solution

by:
neester earned 1000 total points
ID: 12233919
Christy56

There is no doubt you can name the file whatever you like.
You can call it .exe if you like - the file will be the same, but the browser will not treat it the same.

I am assuming that James will be using a server side language to insert these files into a bigger page...
If that is the case, then it doesnt matter what you name it.
They could be .jpg if you liked.

But you wouldnt be able to view the fragment through your browser.
It would assume it is an image, and give you an error when the HTML is loaded instead of the image.

My recommendation stands at:
.htm for fragment.
and a .html if its a full page.

Purely to differentiate the two files - and also because they both will be interpreted correctly by the browser (for the contents that the files hold).
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 12239698
The html extension has nothing to do with whether it is a well-formed and complete document.  the content IS html.  if it is be sued as an include then .inc or .shtml is appropriate, but infact it is a text file and if you give it a .txt extension and send it to a browser, it will still be rendered as html.

Cd&
0
 
LVL 11

Expert Comment

by:neester
ID: 12243463
COBOLdinosaur - but the truth is - there is no real standard here.
.inc is not defined as a HTML fragment...

.txt pages with HTML code SHOULD NOT be rendered HTML.
FireFox doesn't render txt files as HTML.
I just ran a test with the source of this page.

I think James was just looking for some advice on the BEST way to go about it.
I guessed he is using a template system for a website.
And this is the method i have used.
It makes life easier - when looking through folders...

And sometimes a template doenst work, and you can easily load the HTML fragment in the browser still if its a .htm...

THanks for the Grade A James :)
0
 
LVL 11

Expert Comment

by:neester
ID: 12243483
BTW Cd&,
Internet Explorer will not render a .txt with HTML inside it as HTML either.
I just tested it too...
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question