• Resolved zuken86

    (@zuken86)


    Hi, I am trying to give user point every time they click on the link by using mycred_link and some JavaScript to generate a unique id every time the link is clicked. However mycred_link doesn’t seem to recognize the new unique id when it is generated in JavaScript. For what I am trying to achieve, setting no limit in mycred_link hook is not an option. Below is my code:

    <script>
    function getUniqueId(){
    var d = new Date();
    var uniqueId = d.getSeconds();
    var uniqueURL = uniqueId.toString();
    document.getElementById(“vardid”).setAttribute(“id”, uniqueURL);
    }
    </script>
    [mycred_link id=”vardid” href=”https://mysite&#8221; onclick=”getUniqueId()”]GET PTS (+5 PTS)[/mycred_link]

    Am I missing something? Thanks

    • This topic was modified 4 years, 1 month ago by zuken86.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘my_cred link does not give new point for link with unique id’ is closed to new replies.