I have this button in javascript .
<a href="#" onclick="window.location.href = " ' + urlOfNewTask + ' "; return false;">{{"view_task"|translate}}</a>\
var urlOfNewTask = mytaskbaseurl + "." + data.taskEscUrl;
I have this button in javascript .
<a href="#" onclick="window.location.href = " ' + urlOfNewTask + ' "; return false;">{{"view_task"|translate}}</a>\
var urlOfNewTask = mytaskbaseurl + "." + data.taskEscUrl;
Change onclick to onclick="window.location.href = 'urlOfNewTask'; return false;"
If urlOfNeTask is variable then try :
onclick="window.location.href = urlOfNewTask; return false;"
urlOfNewTask is the literal string urlOfNewTask, rather than some global variable (which seems to be the case)
"window.location.href = urlOfNewTask; return false;"or"window.location.href = 'urlOfNewTask'; return false;"ifurlOfNewTaskis a string literal and not some variable'and"in the script - then escape the ones you surround the script inside the script