1๐
โ
Oh, I think I got it. If the code you provided is exactly the same you are using, then you forgot about quotes. It should be like this:
var destination = "{% url 'product_details' pk=soproduct.id %}";
And after that you can make this:
window.location.href = destination;
UPDATE
Please, try to do this:
<a onclick="addCardThenGo('{% url 'add_to_production_board' pk=soproduct.id uri=request.build_absolute_uri %}')">Add to Trello</a>
๐คArtem Kolontay
Source:stackexchange.com