Internet Explorer 11 Back Button Javascript Behavior

后端 未结 5 1334
别跟我提以往
别跟我提以往 2020-12-11 01:37

In Chrome, FF, and IE8-10, when I press the back button, my javascript $(document).ready() function is called, but in IE11, none of the javascript is invoked. Does anyone kn

5条回答
  •  一个人的身影
    2020-12-11 01:58

    I have been equally annoyed with this problem. Why is IE so frustratingly different?

    I found that setting Cache-Control: no-cache in the HTML file wasn't helping. What helped was to actually set that in the response header.

    In my case I'm drawing a Google chart and I need it to redraw whenever I visit the page (IE11 was even preventing the redraw of my chart when I refreshed the page manually!).

    I'm using ASP.NET MVC and this code in my action method solves the problem.

    Response.CacheControl = "no-cache";
    

    Hope this helps.

提交回复
热议问题