IE8 back button and dynamic content

前端 未结 2 420
遇见更好的自我
遇见更好的自我 2021-01-23 02:19

I have a page that pulls an external JavaScript file, which then generates some content dynamically into that page (basically inserts some DIVs and a Flash object).

When

相关标签:
2条回答
  • 2021-01-23 03:00

    You should look into using a history plugin to get consistent results with dynamic content.

    Here is a thread with some plugins jquery history plugin

    0 讨论(0)
  • 2021-01-23 03:19

    I did a quick test using the IE Developer toolbar- I clicked back and nothing happened as you mentioned. I then tried again but before clicking back I cleared my cache, and when I went back the video showed up.

    Try ensuring you force IE to clear the browser cache and your video should load even when clicking on the back page.

    ---- EDIT ADDED AFTER CACHING CONVERSATION ---

    This should not affect the performance of your web application the client browser gains from caching, since you would send back headers to expire/disable the cache only for the page that fires off the JS to embed the video. Everything else- the JS scripts, the graphic/images, and event the video- would still be cached by the client.

    ---- EDIT: UPDATED TO INCLUDE FULL SOLUTION FROM COMMENTS ---

    To disable caching of included JavaScript files one solution is to just append random number in query parameter to the URL, so that browser will not cache the result.

    <script src="jquery.js?t=<?PHP echo rand() ?>">
    

    This avoids the need to modify webserver settings to disable caching static JavaScript files system-wide.

    0 讨论(0)
提交回复
热议问题