• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

WebHelp OnClick Javascript problem

Guest
Mar 25, 2011 Mar 25, 2011

Copy link to clipboard

Copied

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

Views

1.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 25, 2011 Mar 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

Votes

Translate

Translate
LEGEND ,
Mar 25, 2011 Mar 25, 2011

Copy link to clipboard

Copied

Hi,

Try this:

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

Greet,

Willam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 25, 2011 Mar 25, 2011

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 25, 2011 Mar 25, 2011

Copy link to clipboard

Copied

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

Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 25, 2011 Mar 25, 2011

Copy link to clipboard

Copied

Where are you testing from? If you are testing by running the WebHelp from your hard drive immediately after you generate, you might be seeing browser security issues blocking the link and preventing it from working.

Cheers... Rick

Helpful and Handy Links

RoboHelp Wish Form/Bug Reporting Form

Begin learning RoboHelp HTML 7, 8 or 9 within the day!

Adobe Certified RoboHelp HTML Training

SorcerStone Blog

RoboHelp eBooks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 25, 2011 Mar 25, 2011

Copy link to clipboard

Copied

LATEST

Thanks guys - using the example above I just tweaked the code a little and inserted the following into the master page which seems to do the job!

<p><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;
}

var topic_title=getFileName();
document.write(topic_title);
var mailSubject = ' Feedback:Web Analytics Online Help - ' +topic_title;
var mailBody    = topic_title;
var mailDisplay ='Send Feedback'
document.write(
    '<a href="mailto:documentation@blah.com'
    + '?subject=' + escape(mailSubject)
    + '&body=' + escape(mailBody)
    + '">' + mailDisplay + '</a>'
    );</script></p>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation
Download Adobe RoboHelp