Morgan Multimedia programmers have developped a
script written in javascript that detects the browser used to access the page
where you want to include JPEG2000 pictures (.j2c or .jp2 files).
With this information,
it builds the <embed></embed> tag that allows the JPEG2000 file to be displayed,
or, if no plugin is found, that gives the link to the right plugin (IE or
Mozilla).
This script can be found in the file named "j2kpic.js" that you can download
here.
The function is
img_jp2k(filename, width, height).
Here is how to use it:
- Place the file j2kpic.js in the directory where your
html file is.
- Open the html page in an editor.
- Inside the <head></head> tag, insert this line to include the script in your
page:
<script LANGUAGE="JavaScript" src="j2kpic.js"></script>
- Inside the <body></body> tag, look for the places where you want to insert
a JPEG2000 picture.
There, instead of inserting the <embed></embed> tag, just insert this line:
<script language="JavaScript">img_jp2k('MyJPEG2kPic.j2c',
X, Y); </script>
where "MyJPEG2kPic" is the JPEG2000 file you want to embed, and X
and Y are respectively the width and the height.
If you look for a real
example, just look at the source code of this very page.