Linking from CHM with standard HTML

CHM

Linking from CHM with standard HTML

This is a simple sample how to link from a compiled CHM to HTML files. Some files are on a web server some are local and relative to the CHM file.

How to link relative to a HTML file that isn't compiled into the CHM

The following technique of linking is useful if one permanently must update some files on the PC of the customer without compiling the CHM again. The external file must reside in the CHM folder or a subfolder.

Link relative to a external HTML file (external_files/external_topic.htm)

Link code:

<p>
<SCRIPT Language="JScript">
function parser(fn) {
 var X, Y, sl, a, ra, link;
 ra = /:/;
 a = location.href.search(ra);
 if (a == 2)
  X = 14;
 else
  X = 7;
  sl = "\\";
  Y = location.href.lastIndexOf(sl) + 1;
  link = 'file:///' + location.href.substring(X, Y) + fn;
  location.href = link;
 }
</SCRIPT>
</p>

<p>
  <a onclick="parser('./external_files/external_topic.htm')"
  style="text-decoration: underline;
  color: green; cursor: hand">Link relative to a external HTML file (external_files/external_topic.htm)</a>
</p>

 

How to link to HTML pages on the web

Windmill, Germany - Ditzum

In the past, energy was won with windmills in Germany.

See more information about mills (click the link).

These are modern wind energy converters today.

Open technical information on a web server with iframe inside your content window.

Enercon, Germany

 

 

back to top ...