jquery中uploadify外掛程式導致瀏覽器總是崩潰

來源:互聯網
上載者:User

uploadify瀏覽器解決的辦法是: 給引入的js加上一個參數,時間戳記就可以,防止緩衝,使每一次都請求。(這個問題是因為Google瀏覽器會快取檔案導致的)

uploadify可能在某些瀏覽器並不工作,uploadify相容方法:


在swf後面加個參數就可以了 uploadify/uploadify.swf?var='+(new Date()).getTime(),


java

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

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>

總結:其實這在google瀏覽器出現此問題是因為緩衝問題了,加隨機資料也是解決緩衝問題哦。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.