user13527999
user13527999

Reputation:

Using flask url_for in script tag to pass parameters to a route

I want to pass a token to a route from my script tag but cant find a way to make this work.

So far I have made this:

<script>
some code...
  window.location.href = {{ url_for ("payment_success", token=token ) }};
</script>

But it's not returning anything. All my routes are ok. I don't have really much idea about javascript. Thanks in advance

Upvotes: 1

Views: 161

Answers (1)

user13527999
user13527999

Reputation:

The devil hides in details. I forgot to put "" between {{ url_for..... }}

Upvotes: 3

Related Questions