my_cred link does not give new point for link with unique id
-
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” onclick=”getUniqueId()”]GET PTS (+5 PTS)[/mycred_link]Am I missing something? Thanks
- The topic ‘my_cred link does not give new point for link with unique id’ is closed to new replies.