简体   繁体   中英

location.reload altering the url

Does anyone know what could cause this piece of javascript to alter the url:

<script type="text/javascript">
  window.setTimeout(function() {
    window.location.reload(true);
  }, 5000);
</script>

The window location accepts fragments and changes the url from /web/page/123321 to just /web/page

Anyone ever seen anything like this before? Could it just be certain browsers?

Thanks

James

You're closing a php tag inside the setTimeout function.

Try this ...

<script type="text/javascript">
  window.setTimeout("location.reload(true);", 5000);
</script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM