0

I got a global variable XX stored in a config.js file and used throught my application as part of APIs end points. this variable frequently change because of backend create every time a new space with data and provide that variable XX.

Because is difficlut for no-dev to change it every time they want to check new data. i need to store that variable value in the url as http:///XX/....

I have no clue on how to start it and was looking for any ideas or inputs

when i have the variable value changed within my url, my application should render and call apis using the new XX value

ars
  • 1
  • 5

2 Answers2

0

try parsing DOM's location.pathname or location.href

zcionn
  • 71
  • 6
0

Instead of putting such value in URLs why not putting them anywhere in DOM as a data-attribute of an element, or even as meta property and then read it's value in JS?

Adam Kosmala
  • 925
  • 6
  • 9
  • the variable need to be stored there, so any one even not a dev, can change that value within the url and get new data from backend – ars Aug 02 '19 at 01:57