Passing dynamic javascript variable as url in template
问题 I am trying to create a dynamic url in javascript to pass to my html template. In my js, I've got: // dynamic url to edit flashcard function createDynamicURL() { //The variable to be returned var URL; //The variables containing the respective IDs var cardID= cards.cards[current_card].id //this is defined earlier //Forming the variable to return URL-="study/[1-9][0-9]/"; URL+="card-edit/"; URL+=cardID; return URL; } And in my template I have: <a id="edit-button" class="btn btn-default btn