How to get the headers parameters in the url forwarded through the background?

for example, after a business is processed in the background, the backend forwards a url to the front-end route, and puts a parameter in the response headers in this url. So, how do you get this parameter? Does js have an idea? Thank you.

Mar.02,2021

  1. if there are not many parameters, you can put it directly in url.
  2. use document.location.href to get the returned url,
  3. define a parsed url function:
function urlParse(urlString){
  // let url = decodeURIComponent(urlString);
  let url = urlString;
  let obj = {};
  let reg = /[?&][^?&]+=[^?&]+/g;
  let arr = url.match(reg);
  if(arr){
      arr.forEach((item)=>{
          let  tempArr =  item.substring(1).split('=');
          let key = decodeURIComponent(tempArr[0]);
          let value = decodeURIComponent(tempArr[1]);
          obj[key] = value;
      })
  }
  return obj;
}

the above function returns a json object;

4. Then print that object, and you can start playing

.
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-1b3b39f-2c260.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-1b3b39f-2c260.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?