Why does JavaScript only work after opening developer tools in IE once?

前端 未结 12 2083
予麋鹿
予麋鹿 2020-11-22 02:20

IE9 Bug - JavaScript only works after opening developer tools once.

Our site offers free pdf downloads to users, and it has a simple \"enter password to download\" f

12条回答
  •  灰色年华
    2020-11-22 02:34

    I put the resolution and fix for my issue . Looks like AJAX request that I put inside my JavaScript was not processing because my page was having some cache problem. if your site or page has a caching problem you will not see that problem in developers/F12 mode. my cached JavaScript AJAX requests it may not work as expected and cause the execution to break which F12 has no problem at all. So just added new parameter to make cache false.

    $.ajax({
      cache: false,
    });
    

    Looks like IE specifically needs this to be false so that the AJAX and javascript activity run well.

提交回复
热议问题