The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Detect if Topic in CHM exists
Kittio
post 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;
}
}
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 27th April 2024 - 07:08 AM