[Fixed]-How to execute Django uri template tags from within client side Java Script?

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

Leave a comment