Skip to main content
March 25, 2011
Answered

WebHelp OnClick Javascript problem

Hello there,

I wanted to insert an email feedback link into my webhelp file.

So in my Master Page I added the following link in the header of the page:

<a href = "Send feedback" onClick="parent.location='mailto:documentation@whatever.com?Subject=blah blah'"> </a>

It works fine. THe link is displayed on all pages and when I click on it an email is generated. Problem is after I click on the link in webhelp, the page in the right of the frame i.e. the topic I'm viewing is refreshed and it says "Internet Explorer cannot display the webpage".

Any ideas how I can fix this?

Thanks

    This topic is closed to new replies. Start a new post to keep the conversation going.
    Peter Grainge
    Peter GraingeCorrect answer
    Community Expert
    March 25, 2011

    Try this script.

    http://www.grainge.org/pages/snippets/mailto.htm

    I'm not sure it will work from a master page but it does work in the body.


    See www.grainge.org for RoboHelp and Authoring tips

    @petergrainge

    Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.

    5 replies

    Willam van Weelden
    Inspiring
    March 25, 2011

    Hi,

    Try this:

    <a href="javascript:void(0);" onclick="mailto:documentation@whaterver.com?Subject=subject">Send feedback</a>

    Greet,

    Willam

    Translate
    March 25, 2011

    Thanks,

    It doesn't work at all with that hehe

    It's a bit annoying basically I've found some javascript that should in theory allow me to let a user submit feedback and it will send the title of the page they are viewing. This is how its meant to work:

    <head>
    <script type="text/javascript">
    function getFileName() {
    //this gets the full url
    var url = document.location.href;
    //this removes the anchor at the end, if there is one
    url = url.substring(0, (url.indexOf("#") == -1) ? url.length : url.indexOf("#"));
    //this removes the query after the file name, if there is one
    url = url.substring(0, (url.indexOf("?") == -1) ? url.length : url.indexOf("?"));
    //this removes everything before the last slash in the path
    url = url.substring(url.lastIndexOf("/") + 1, url.length);
    //return
    return url;
    }

    function EmailLink()

    {
    topictitle=getFileName();
    document.write(topictitle);
    window.location = "mailto:documentation@blah.com "+" ?subject= Re: Web Analytics help - "+ topictitle;"sometitle"
    }


    </script>
    </head>

    <FORM>
    <a href = "E-mail" onClick="EmailLink()">Email </a>
    </FORM>

    So it works fine from within a web browser...but for some reason - it won't work from within webhelp when it's embedded into my master page

    Translate
    Peter Grainge
    Community Expert
    Peter GraingeCommunity ExpertCorrect answer
    Community Expert
    March 25, 2011

    Try this script.

    http://www.grainge.org/pages/snippets/mailto.htm

    I'm not sure it will work from a master page but it does work in the body.


    See www.grainge.org for RoboHelp and Authoring tips

    @petergrainge

    Translate
    Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.