Launching help via javascript from external domain

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
3lliot
Sr. Propeller Head
Posts: 105
Joined: Wed Mar 23, 2011 8:45 pm

Launching help via javascript from external domain

Post by 3lliot »

I'd like to link to a webhelp system (on our web server) from a customer's site, using javascript, so I can control the appearance of the browser window (i.e. deactivate default browser settings like toolbars, address bar etc.)

Apparently this involves launching using some javascript that Flare provides. My question is, if the help system is published only to our domain, but launched from the customer's domain, would the customer also have to have the javascript published to their web server in order for javascript to work? my hunch is that it would (unless we also add a link to the javascript on our web server from their web server - but I'm not even sure that would work).

I'd rather not ask the customer to install proprietary madcap javascript on their website (we may be doing this for a lot of customers) so may have to fall back on launching via URL and forgo the custom browser window options.

Has anyone tried this, and if so, did you find any workarounds?

cheers
-E
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Launching help via javascript from external domain

Post by NorthEast »

Making javascript CSH calls is covered in the help here:
http://webhelp.madcapsoftware.com/flare ... lopers.htm

The javascript link would need to point to the js file in the root folder of your WebHelp.

For example, this would be a javascript link to the Flare online WebHelp:

Code: Select all

...
<head>
<script type="text/javascript" src="http://webhelp.madcapsoftware.com/flare7/Default.js"></script>
</head>
<body>
<input type="button" value="Open Help System" onclick="FMCOpenHelp( null, null, 'CSH', true );" /> 
</body>
...
3lliot
Sr. Propeller Head
Posts: 105
Joined: Wed Mar 23, 2011 8:45 pm

Re: Launching help via javascript from external domain

Post by 3lliot »

Ok thanks, I'll give that a shot.

cheers
3lliot
Sr. Propeller Head
Posts: 105
Joined: Wed Mar 23, 2011 8:45 pm

Re: Launching help via javascript from external domain

Post by 3lliot »

Great, that worked, thanks again.

However: the skin allows the specification of browser settings (toolbar, menu bar etc.). In order for these to take effect, the help must be launched via javascript.

But FMCOpenHelp does not include syntax for opening the help in a new window, as far as I can see. So the help just opens in a new browser tab. Which renders the browser settings useless.

What I want to be able to do is launch our help from a client's website, but with things like the location (address) bar deactivated, to hide the fact that the help actually resides on our domain, not the client's domain.

Would you (or anyone) know of any other way to do that?
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Launching help via javascript from external domain

Post by NorthEast »

I don't use the javascript method for CSH calls, so I don't know any workarounds.

However, you can open a new window and specify its size and other properties by using a bit of javascript; and use Flare's URL method to make the CSH call.

For example, this button will use the javascript window.open to open the window; this contains a number of properties:
- The URL is the link to the WebHelp, in the 'URL' format for making CSH calls; in this case it is a search for "CSH", and shows the first result.
- The _blank property makes the window open in a new window instead of a tab.
- The window properties are set in the section along with the width/height.

Code: Select all

<input type="button" value="Open Help System" onclick="window.open('http://webhelp.madcapsoftware.com/flare7/Default_CSH.htm?CSH|FirstPick', '_blank', 'width=500, height=500, location=0', null);" />
For details of window.open, see: http://www.w3schools.com/jsref/met_win_open.asp

I would suggest making your own javascript function to simplify the format of the call for 3rd parties; which anyone with web/javascript experience should be able to do.

Also, note that most browsers now do not allow you to hide the location bar, even if you try and switch off the location property. This is for obvious security reasons, as it's mainly only disreputable sites that want to hide their URL. You may also irritate some users, if they've set their browser to open links in tabs instead of windows, and you override their settings.
3lliot
Sr. Propeller Head
Posts: 105
Joined: Wed Mar 23, 2011 8:45 pm

Re: Launching help via javascript from external domain

Post by 3lliot »

Great, I'll use that instead.
cheers
Post Reply