Doee
Doee

Reputation: 23

Link button doesn't function in javascript

I have this button in javascript .

 <a href="#" onclick="window.location.href = " ' + urlOfNewTask + ' "; return false;">{{"view_task"|translate}}</a>\
All I want to do is to close this modal after I click on it( for this I insert return false) and this button to take me to the link inside the onclick function. The problem is that when I click at the button nothing happens, nor close of the modal nor open the link. Have i done something wrong? Here is the variable :

var urlOfNewTask = mytaskbaseurl + "." + data.taskEscUrl;

Upvotes: 0

Views: 76

Answers (1)

Abhijeet
Abhijeet

Reputation: 4309

Change onclick to onclick="window.location.href = 'urlOfNewTask'; return false;"

If urlOfNeTask is variable then try :

onclick="window.location.href = urlOfNewTask; return false;"

Upvotes: 1

Related Questions