最近做的项目使用了jquery的uploadify,但是在谷歌浏览器测试总是会出现崩溃。如:

[Bug]转:使用jquery的 uploadify,在谷歌浏览器上总会崩溃的解决方法

因为是java项目。

解决的办法是: 给引入的js加上一个参数,时间戳就可以,防止缓存,使每一次都请求。(这个问题是因为谷歌浏览器会缓存文件导致的)

<script type="text/javascript" src="../common/uploadify/jquery.uploadify.js?f=<%=System.currentTimeMillis()%>"></script>

网上还有这些:

根据stackoverflow上的帖子,

  • Asp.Net Web From

    <script src="/Resources/uploadify/jquery.uploadify3.1Fixed.js?ver=<%=(new Random()).Next(0, 99999).ToString() %>" type="text/javascript"></script>
  • Asp.Net MVC

    <script type="text/javascript" src=@Url.Content("~/Content/uploadify/jquery.uploadify3.1Fixed.js?ver=")@DateTime.Now.Ticks></script>
  • PHP

    <script src="js/jquery.uploadify.min.js?ver=<?php echo rand(0,9999);?>" type="text/javascript"></script>

相关文章:

  • 2021-11-08
  • 2021-12-10
  • 2021-06-22
  • 2021-11-27
  • 2021-11-27
  • 2021-10-21
  • 2022-12-23
  • 2021-11-27
猜你喜欢
  • 2021-12-24
  • 2021-06-07
  • 2021-06-16
  • 2021-11-27
  • 2021-11-27
  • 2021-07-12
  • 2021-11-26
相关资源
相似解决方案