
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
1 Correct answer
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
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

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
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
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! |

Copy link to clipboard
Copied
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>

