[removed] How to truly reload a site with an anchor tag?

前端 未结 6 2105
遇见更好的自我
遇见更好的自我 2020-12-15 16:27

Take this code snippet for example:

window.location.href = \'mysite.htm#images\';

Already being on the site mysite.htm and tri

6条回答
  •  被撕碎了的回忆
    2020-12-15 16:57

    use the query part of the URL to add a random string:

    // Use a timestamp to make sure the page is always reloaded
    window.location.href = 'mysite.htm?r='+(+new Date())+'#images';
    

提交回复
热议问题