Want to open a html to initialize an id to its url

like this
clipboard.png
:

clipboard.png
but the problem is that it keeps refreshing when the page is opened. I don"t know if my method is wrong. I ask the bosses to take a look at it for me. Window.location.href has also tried, but it still doesn"t work

.
Mar.16,2021

you write this directly, of course, it keeps refreshing, because every time you modify window.location.search, the page reloads, and then you execute this statement, so it loads again. So you should add a logical judgment, for example, if you already have an id parameter, do not execute the statement that modifies window.location. That would be fine.

Menu