The follwing javascript code is doing what it's intended to do, which is to replace the URL but then the page won't stop reloading/refreshing. Is there a way to stop it?
Original page is: www.xyz.com/used-vehicles
, but I want to automatically use the checkbox filter options on that page which adds to the URL after used-vehicles ?search=certified%2Cpreowned
<script>
document.location.replace('/used-vehicles?search=certified%2Cpreowned');