How can js modify another js file to ensure that the js will not be modified again?

is dealing with a requirement, which goes something like this: is to determine where the entry of the website comes from . If the website is linked from a certain platform (for example, when a web page is placed on the e-shift platform for light application), you need to record the parameter xx, of url and then jump to the authorization page once the login credential token expires. If the website is entered from our own login page, token fails to jump to its own login page instead of to the authorization page

my idea is: because when entering a web page from the platform, the url of the page will take a parameter xx, of that platform, and then I use a global js to record the xx,. I hope that the global js can be used by each page: similar to

.
js:
function yy(name){
 ...//url
}
var xx=yy(name);//,url

but in this case, if I call the global js on every page, because only the entry page has the parameter of url, so the url of other pages does not have this url parameter. This will cause the xx not to be a fixed value. Which page call will refresh the js, on that page and the xx recorded by the js file will be overwritten when the page calls the js file, so is there any way to solve it?

Mar.23,2021

is saved in cookie or session or localstorage


this is usually saved with cookie or session.


cookie learn about
window.name

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5f9ba-45855.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5f9ba-45855.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?