Javascript Provide Feedback Link

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
parsonsv
Sr. Propeller Head
Posts: 110
Joined: Fri Mar 23, 2007 12:30 pm
Location: Calgary, Alberta

Javascript Provide Feedback Link

Post by parsonsv »

I saw the following information online (@ http://www.idratherbewriting.com/2008/1 ... rom-users/) and I'd like to try it in my Webhelp. However, what would this link look like in my code?:
Create a “Send Feedback” Link in Your Online Help
I add a Send Feedback link on every page of my online help. This allows users a point of connection when they can’t find what they’re looking for in the help. I add the Send Feedback link on the master page of my webhelp target, so one instance in the footer automatically propagates to every help topic.

The link contains a javascript that opens the user’s default email program and inserts the absolute URL of the help topic he or she was on at the time. This link is important in identifying the problem the user was trying to solve, because often the messages users send are cryptic and ungrammatical. It also lets you know they were actually in the help. Here’s the script:

<script type=”text/javascript”>document.write(“<a href=\”mailto:tomjohnson1492@gmail.com?subject=ACME%20Application%20(“+document.title+”)&body=”+location.href+”%0A%0A”+”\”>Send Feedback</a>”);</script>
Victoria Clarke
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Javascript Provide Feedback Link

Post by RamonS »

The code should be the same except for the email address and the subject. You need to put your email address in and change the subject parameter value according to what you want the subject to be.
parsonsv
Sr. Propeller Head
Posts: 110
Joined: Fri Mar 23, 2007 12:30 pm
Location: Calgary, Alberta

Re: Javascript Provide Feedback Link

Post by parsonsv »

Unfortunately, I keep getting an error when I try to save this code in my topic.

'\' is an unexpected token. The expected token is ' " or '''.

The position that's being targeted by the error is the \ that comes right after href=. Can you see any problems with the line or where the missing punctuation might be?

Code: Select all

<script type="text/javascript">document.write("<a href=\"mailto:name@email.com?subject=ACME%20Application%20"("+document.title+")&body="+location.href+"%0A%0A"+"\">Send Feedback</a>");</script>
Victoria Clarke
parsonsv
Sr. Propeller Head
Posts: 110
Joined: Fri Mar 23, 2007 12:30 pm
Location: Calgary, Alberta

Re: Javascript Provide Feedback Link

Post by parsonsv »

Good news - if I strip out the script brackets from the beginning and end, and then use Insert Script from Flare, it works.
Victoria Clarke
JasonSTI
Sr. Propeller Head
Posts: 110
Joined: Mon Jan 07, 2008 11:34 am

Re: Javascript Provide Feedback Link

Post by JasonSTI »

Javascript is finicky about using quotation marks within quotation marks. The slash is supposed to cause this "inner" quotation mark to not count, but making sure you get it done properly is troublesome. Replace the "inner" quotes with apostrophes instead.

Code: Select all

<script type="text/javascript">document.write("<a href='mailto:name@email.com?subject=ACME%20Application%20("+document.title+")&body="+location.href+"%0A%0A'>Send Feedback</a>");</script>
tomjohnson1492
Propeller Head
Posts: 90
Joined: Wed Nov 07, 2007 11:08 pm
Location: Salt Lake City
Contact:

Re: Javascript Provide Feedback Link

Post by tomjohnson1492 »

I just stumbled on this post. I had errors using the javascript code below. This is what I ended up adding:

Code: Select all

  <script type="text/javascript">/*<![CDATA[*/document.write("<a href=\"mailto:youremail@company.org?subject=ACME%20Application%20("+document.title+")&body="+location.href+"%0A%0A"+"\">Send Feedback</a>")/*]]>*/</script>
-------------
my blog/podcast: http://www.idratherbewriting.com
sham
Jr. Propeller Head
Posts: 2
Joined: Wed Aug 25, 2010 8:20 pm

Re: Javascript Provide Feedback Link

Post by sham »

Hi Everyone,

I am new to flare and I need your advice in order to get this working on my project.

I have tried using the Java script and Flare keep promting an error message stating : Internal Error - Object reference not set to an instance of an object.

The code added:

<script type="text/javascript">/*<![CDATA[*/document.write("<a href=\"mailto:myemailid@companyname.com?subject=Test%20Feedback%20("+document.title+")>Send Feedback</a>")/*]]>*/</script>

I dont know what mistake i have made with the syntax.

Please somebody help me...
kmiller
Propeller Head
Posts: 11
Joined: Wed Jun 01, 2011 2:50 pm
Location: Northern Colorado

Re: Javascript Provide Feedback Link

Post by kmiller »

It took me several tries, but I finally figured out what this means:
parsonsv wrote:Good news - if I strip out the script brackets from the beginning and end, and then use Insert Script from Flare, it works.
Here are the steps to insert this feedback link:
1. Place your cursor where you want the link.
2. From the Insert menu, select Script.
3. In the Language field, select text/javascript.
4. In the Script Code field, paste this code (with the email address, subject, and link text changed appropriately):

Code: Select all

document.write("<a href='mailto:email@company.com?subject=Online%20Help%20("+document.title+")&body="+location.href+"%0A%0A'>Send Feedback</a>");
5. Click OK.
Karen Miller
Post Reply