Can't add hyperlink using Javascript?

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
dorcutt
Sr. Propeller Head
Posts: 234
Joined: Thu May 15, 2014 12:16 pm

Can't add hyperlink using Javascript?

Post by dorcutt »

So, I'm trying to add a script to my Master Page to add a mailto Feedback hyperlink. However, I can add whatever I want, so long as it isn't a hyperlink. I'm still using 10.2.2 until my organization can find the keys that were mailed to us :roll:

This is my simple script:

Code: Select all

<div>
            <script type="text/javascript">
				$(document).ready(function(){
				  $("#Feedback").append("<p><u>Hello Again</u><a href="mailto:dorcutt@example.com">Email us!</a></p>");
				});
			</script>
</div>
If I cut out the <a> tag, the paragraph tag is added fine. If I replace the <a> tag with "Hello, World" it also works fine. Simple links to google also do not work.

I'm assuming this is a security "feature." How can I get around this (safely)?
-Dan, Propellerhead-in-training
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Can't add hyperlink using Javascript?

Post by NorthEast »

The script isn't valid because you have nested double quotes (") inside the append section.
$("#Feedback").append("<p><u>Hello Again</u><a href="mailto:dorcutt@example.com">Email us!</a></p>");

Replace one of these pairs with single quotes (').
dorcutt
Sr. Propeller Head
Posts: 234
Joined: Thu May 15, 2014 12:16 pm

Re: Can't add hyperlink using Javascript?

Post by dorcutt »

Blessings upon you and your household, Dave Lee. It would have taken me quite a long time indeed to think of that.
-Dan, Propellerhead-in-training
Post Reply