javascript on jump button not working anymore

This forum is for all Flare issues related to the Microsoft HTML Help target.
This target produces "CHM" files in the output.
Post Reply
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

javascript on jump button not working anymore

Post by i-tietz »

Hi there folks,
I found out that our old js on a jump button isn't working anymore ... I cannot figure out why.
The situation:
We have a jump button calling a topic that has an onload-javascript saying that an external browser window is to be opened and in the help it goes back to the last topic. The source code in the text editor:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd">
    <head>
<script type="text/javascript">
function onw() {
  nw = window.open("http://www.hamburger-software.de/support", "nw");
  nw.focus();
}
</script>
</head>
<body onLoad="onw();history.back();"></body>
</html>
The source code of the topic in the HTML Help:

Code: Select all

<?xml version="1.0" encoding="Windows-1252"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" MadCap:tocPath="" MadCap:PathToHelpSystem="../../" MadCap:SearchType="Stem">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" /><title>jump_new</title>
        <script type="text/javascript">
function onw() {
  nw = window.open("http://www.hamburger-software.de/support", "nw");
  nw.focus();
}
</script>
        <script src="../SkinSupport/MadCapUtilities.js">
        </script>
        <script src="../SkinSupport/MadCapBody.js">
        </script>
        <script src="../SkinSupport/MadCapHighlighter.js">
        </script>
    </head>
    <body onLoad="onw();history.back();">
        <script type="text/javascript" src="../SkinSupport/MadCapBodyEnd.js">
        </script>
    </body>
</html>
I click the jump button and get this:
error_message.gif
and the browser window opens with the correct URL...

In RH everything worked ...
What's the reason for the error?
How to get rid of it?
You do not have the required permissions to view the files attached to this post.
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: javascript on jump button not working anymore

Post by i-tietz »

Update:
I get the error with Firefox being my standard browser.
No problems with IE.
Pete Lees
Sr. Propeller Head
Posts: 150
Joined: Thu Feb 09, 2006 12:33 pm
Location: Bracknell, Berkshire, UK

Re: javascript on jump button not working anymore

Post by Pete Lees »

Hi,

Can you use a Shortcut control instead, or are you trying to work around the issue where Shortcut controls are disabled in Help files that are stored on a network drive?

The coding of the Shortcut control looks something like this:

Code: Select all

<object id="hhctrl" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
    <param name="Command" value="ShortCut" />
    <param name="Button" value="Text:View Web Site" />
    <param name="Item1" value=",http://www.hamburger-software.de/support," />
</object>
Clicking the button opens the Web page in the user's default browser.

Pete
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: javascript on jump button not working anymore

Post by i-tietz »

Pete Lees wrote:Can you use a Shortcut control instead, or are you trying to work around the issue where Shortcut controls are disabled in Help files that are stored on a network drive?
No, nothing like that. We have a button in the buttonbar.
buttonbar_support.gif
The target of the jump (in the skin) is a topic that contains the code I gave in the first post.

IE=standard browser: IE opens with the correct URL and the empty topic inside the help is replaced by the topic that was there before. The browser window is in front.
Firefox=standard browser: Firefox opens with the correct URL and the HTMl help comes to the front showing an empty topic and the javascript error.

That sort of redirect works with shortcut controls, too?
You do not have the required permissions to view the files attached to this post.
Pete Lees
Sr. Propeller Head
Posts: 150
Joined: Thu Feb 09, 2006 12:33 pm
Location: Bracknell, Berkshire, UK

Re: javascript on jump button not working anymore

Post by Pete Lees »

You could try linking the Jump button to a topic like this one:

Code: Select all

<html>
<body onLoad="hhctrl.Click();history.back()">

<object id="hhctrl" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
  <param name="Command" value="ShortCut" />
  <param name="Item1" value=",http://www.hamburger-software.de/support," />
</object>

</body>
</html>
Pete
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: javascript on jump button not working anymore

Post by i-tietz »

The code doesn't work, if the .chm file is on a network drive:
shortcut_error_message_on_network_drive.png
Everything's fine, if the file is on my local harddisk ...

SUGGESTIONS?
You do not have the required permissions to view the files attached to this post.
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: javascript on jump button not working anymore

Post by KevinDAmery »

By default, Windows doesn't support CHMs on the network anymore since they made a security change a few years ago. (it's the usual Microsoft approach to security problems: "the lock on the door can be picked, so to make sure no one can break in we'll knock the building down" :roll: ) So, since CHMs aren't supported on the network, the fact that javascript doesn't behave there doesn't surprise me.

Here's Madcap's KB on CHMs on the network:
http://kb.madcapsoftware.com/Content/Fl ... cation.htm

And here's Microsoft's info on the issue
http://www.microsoft.com/technet/securi ... 5-026.mspx
Until next time....
Image
Kevin Amery
Certified MAD for Flare
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: javascript on jump button not working anymore

Post by i-tietz »

GREAT!
So we don't have to bother about that anymore ...
THANX!
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: javascript on jump button not working anymore

Post by i-tietz »

Maybe I was a little bit too fast hoping that was it:
Generally it's working, but with one fault: The help window gets the focus and the browser is in the background ...
Any parameters that prevent that?
Pete Lees
Sr. Propeller Head
Posts: 150
Joined: Thu Feb 09, 2006 12:33 pm
Location: Bracknell, Berkshire, UK

Re: javascript on jump button not working anymore

Post by Pete Lees »

If you check the window definition for the Help viewer, you may find that there is a "Topmost" setting (or some similarly-named setting) that you have enabled. Turning this off should stop the Help viewer from retaining the focus when the browser window is opened.

Pete
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: javascript on jump button not working anymore

Post by i-tietz »

Pete Lees wrote:If you check the window definition for the Help viewer, you may find that there is a "Topmost" setting (or some similarly-named setting) that you have enabled.
???
"window definition for the Help viewer"? Where would I find that?
Do you mean that:
skin_topmost.png
?
As you see it's not checked.
You do not have the required permissions to view the files attached to this post.
Post Reply