Rate this article
", "answerCount": 1, "upvoteCount": 0, "datePublished": "2015-06-02T23:56:19.000Z", "author": { "@type": "Person", "name": "Kevin Dyer", "url": "https://trailblazers.salesforce.com/profileView?u=00530000009OjARAA0", "affiliation": { "@type": "Organization", "name": "Medallia" } }, "suggestedAnswer": [ { "@type": "Answer", "text": "Kevin, Use this  var fname = '{!$User.firstName}'; var lname = '{!$User.lastName}'; var email = '{!$User.email}'; Instead of this, var fname = '{!CurrentUser.firstName}'; var lname = '{!CurrentUser.lastName}'; var email = '{!CurrentUser.email}'; --Akram", "upvoteCount": 0, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007T6JevSAF", "datePublished": "2015-06-03T22:47:42.000Z", "author": { "@type": "Person", "name": "Sarfarajey Akram Mir", "url": "https://trailblazers.salesforce.com/profileView?u=00530000009bKykAAE", "affiliation": { "@type": "Organization", "name": "Ford Motor Company" } } } ] } } Skip to main content
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>
1 个回答
  1. 2015年6月3日 22:47
    Kevin,

    Use this 

    var fname = '{!$User.firstName}';

    var lname = '{!$User.lastName}';

    var email = '{!$User.email}';

    Instead of this,

    var fname = '{!CurrentUser.firstName}';

    var lname = '{!CurrentUser.lastName}';

    var email = '{!CurrentUser.email}';

    --Akram

0/9000