Issue
I want to pass javascript string variables and render them on the URL.
For example, if I have URL = "xyc.com". Once there is a variable (a) populated, I want that variable to be rendered in the address bar with URL = "xyc.com/?a=" .
I am currently using the flask and .ajax function in javascript (where the variable is being populated) in this application. Can someone please provide me some guidance on how I can accomplish this? Thank you!
Solution
If you want to replace the URL without reloading the page
window.history.replaceState(null, null, new_url);
If you want to reload the page with your new URL
window.location.href = new_url
Answered By - Robin
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.