rewriting links in the web browser activex control

On the aware list someone was looking for a way to trap and react to links clicked in an html document that is embedded in Authorware using the web browser activex control. In this case editing the html was not a prefered route so it was suggested that he dynamically rewrite the links in the page. Using the #CallString method of the activex control it’s possible to access the DOM (Document Model Object) of an html document. This is actually quite a versatile technique, allowing us to read and manipulate the html. Rewriting the links was quite straighforward thanks to the links array of the DOM which holds all the html a objects that have a href property.

In order to demonstrate the approach I put together a quick example that amalgamates all the great aware member contributions. I tried it out with both IE6 and IE5 (rolled back). If you find any limitations do drop some details in the comments section. Also here are a couple of MSDN links that may be useful if you’re interested in using the browser activex control in Authorware:
WebBrowser Control Reference
DHTML Reference

Leave a Reply