分类: 系统运维
2009-08-27 20:14:57
Some possible methods of embedding TIFF files in HTML documents are demonstrated below.
The examples assume you have a TIFF document accessible at the relative URL "tiffdocument.tif". To demonstrate how to pass parameters (when possible), we show how to tell AlternaTIFF to display a photo-negative of the image. The examples with a green background are the ones we consider to be the best choices.
You should also make sure your web server is configured to assign the MIME type "image/tiff" to your TIFF files. Most web servers will do this by default.
This document also includes a section on .
The simplest and most reliable method is probably just to use the embed tag. However, embed is not a standard HTML element (prior to HTML 5).
Make sure to include width, height, and src attributes. The type attribute is optional but recommended.
HTML code | How your browser handles it |
---|---|
Refer to Microsoft's documentation.
HTML code | How your browser handles it |
---|---|
embed.js: document.write(' |
This may be the most popular way to embed plug-ins and ActiveX controls in web pages. It's bloated and nonstandard, but it works with almost any browser. Note that this will force Internet Explorer to use AlternaTIFF if it is installed, even if it isn't the default TIFF viewer.
HTML code | How your browser handles it |
---|---|
You can try to cover all bases by putting the URL in both a "data" attribute and a "" element. The result is syntactically valid, and seems to work well enough in current web browsers. But there may be with it, and it may not work at all in older web browsers.
HTML code | How your browser handles it |
---|---|
The object element works best in IE when you include a classid attribute, which is the unique identifier of the control you want to use. This method will force your visitors to use AlternaTIFF, even if they have another TIFF viewer installed. It's unlikely to work in browsers other than IE.
HTML code | How your browser handles it |
---|---|
This method is not recommended, because too many browsers fail to follow the standard. As of this writing, it does not work in IE.
HTML code | How your browser handles it |
---|---|
Using frames is easy, but it prevents you from passing parameters to AlternaTIFF, may make scripting more difficult or impossible, and can lead to .
HTML code | How your browser handles it |
---|---|
Few browsers support TIFF images in tags.
HTML code | How your browser handles it |
---|---|