A customer is reporting that they get the following message when opening the .CHM file (which then proceeds to work fine...):
"Unable to get value of the property 'getElementsByTagName': object is null or undefined."
URL points to .../SkinSupport/MadCapToolbar.js
The offending code is:
FMCGetSkin(function (xmlDoc) {
var buttons = null;
var nodeName = gIsTopicToolbar ? "TopicToolbar" : "Toolbar";
var toolbarNode = xmlDoc.getElementsByTagName(nodeName)[0];
I can see similar issues with js on this forum, but they all seem to be webhelp/browser issues.
Any tips?
js script error 'getElementsByTagName'
Re: js script error 'getElementsByTagName'
I had a similar error, which was related to making CSH calls with a null value to a CHM file which has a topic toolbar.
The workaround suggested by MadCap support that fixed the problem was to select a Startup Topic in the target (General tab), rather than leave it set as (default).
The workaround suggested by MadCap support that fixed the problem was to select a Startup Topic in the target (General tab), rather than leave it set as (default).
MadCap support wrote:We were able to replicate the bug with a sample project and test application.
As a workaround, please try selecting a startup topic and let me know if the JS error still appears. If the application calls a topic, it should work fine. Calls to the base index or TOC cause the script errors.
The bug is exactly what you previously described where a null value is being used in the CSH call.
Re: js script error 'getElementsByTagName'
Many thanks for that Dave - I did have a 'default' startup topic, so have done what you suggest and will get customer to test - can't replicate here. If problem persists will raise with MC support.