Detect if Topic in CHM exists |
Detect if Topic in CHM exists |
Kittio |
Jul 31 2007, 09:24 PM
Post
#1
|
Group: Members Posts: 1 Joined: 31-July 07 Member No.: 3,474 |
Is there a way with a JS file to detect the existence of a topic in a CHM file without opening the topic?
Background I am investigating ways of appending conditional links to CHM topics so that the links only show if the target chm/topic exists. What I was thinking is that I could add a <SPAN ID=”addOn”></SPAN> tag to all the HTMs in CHMs we ship and then add an OnLoad function in the JS to search for topics of the same topic name in another CHM (in the same folder). If found, then add the link where the <SPAN tag is. (I put the code below.) This way we or ISVs could issue a NewContent.CHM with added info to customers that will dovetail nicely into the existing topics. The problem is that I can’t seem to detect if a specific topic in NewContent.chm exists. My java skills are not that great and need advice on whether this is possible or not. function LoadPage() { \\ other onload steps…. try { AddOnAppendedContent(addOn); } catch(e) {} } function AddOnAppendedContent(LinkSpanTag) { var CheckURL = 1; //set for testing var a = document.URL; var myURL = a.substring(a.lastIndexOf("html")+5,a.length); if ( CheckURL = true) // need to find a way to detect the target here. { myAddOnLinkText = "<p><a href='ms-its:NewContent.chm::/html/" + myURL.substring(0,36) + ".htm'>My Added Link</a></p>"; LinkSpanTag.innerHTML = myAddOnLinkText; } } |
Darin McGrew |
Jul 31 2007, 09:44 PM
Post
#2
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
You're more likely to get an answer to your question in a forum dedicated to Microsoft's "HTML Help" product.
This one is dedicated to promoting creative, informative, browser-independent, and resolution-independent web sites that are accessible to all users worldwide. |
Lo-Fi Version | Time is now: 28th April 2024 - 01:39 AM |