You need to sign in to do that
Don't have an account?
Kevin Dyer
Adding an onclick function to go to url in javascript Salesforce Communities
I am using this JavaScript to display a hyperlink. When I click the link, I am not taken anywhere. Could you please let me know why that might be?
<script >
//get survey link
function goSurvey() {
var param = '';
var url = document.URL;
var match = /(\/article\/)(.*)/g.exec(url);
if(match!=null) {
var param = match[2];
}
var fname = '{!CurrentUser.firstName}';
var lname = '{!CurrentUser.lastName}';
var email = '{!CurrentUser.email}'; {!
var link = 'http://survey.medallia.com/articlefeedback?u=' + param + '&e=' + email + '&f=' + fname + '&l=' + lname;
window.open(link);
};
</script>
<center>
<a id="articleFeedback" title="Rate this article" href="#" onclick="goSurvey();return false;">Rate this article</a>
</center>
<script >
//get survey link
function goSurvey() {
var param = '';
var url = document.URL;
var match = /(\/article\/)(.*)/g.exec(url);
if(match!=null) {
var param = match[2];
}
var fname = '{!CurrentUser.firstName}';
var lname = '{!CurrentUser.lastName}';
var email = '{!CurrentUser.email}'; {!
var link = 'http://survey.medallia.com/articlefeedback?u=' + param + '&e=' + email + '&f=' + fname + '&l=' + lname;
window.open(link);
};
</script>
<center>
<a id="articleFeedback" title="Rate this article" href="#" onclick="goSurvey();return false;">Rate this article</a>
</center>
Use this Instead of this, --Akram