how to use js function after using windows.location.replace

Is it possible to run a js functionscript after using already the windows.location.replace to get to a new website.

I need to use the script after the page load with the parameters I provide.

All my code is in html file running the scripts.

any help will be welcome.
thanks in advance.