Development bug record

1. windows.href.location download file

When using windows.href.location to download files in js, the window cannot be called in the method due to scope reasons, and the window will report undefined at this time. Just call href.location directly in the method.

2. How to make the gif reload every time it enters the page

If you use gif animation during development, you may encounter a problem. Although the page is refreshed when you leave the page and re-enter the page, the gif will not be reloaded. At this time, what we see is only the picture after the GIF is loaded. This is because the browser has a cache mechanism for images. At this time, we need to use the location.reload() method to force refresh the current page and clear the cache of the page before leaving the page.   

Or before the page is about to be left, manually clear the cached data stored in sessionStorage for the current page.

 

Guess you like

Origin blog.csdn.net/wangshuaibinggg/article/details/131048406