php – 在Chrome中Uploadify返回Aw,Snap页面

前端之家收集整理的这篇文章主要介绍了php – 在Chrome中Uploadify返回Aw,Snap页面前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
从最后更新的chrome(版本36.0.1985.125 m)我有uplodify插件/闪存的问题. Chrome显示Aw,Snap页面或有时他死了,Jim!这是我的uplodify代码
  1. <input type="file" name="file_upload" id="file_upload_50">
  2. <script type="text/javascript">
  3. var basePath = "path to ressources";
  4. var errorMessage = "Error Message";
  5. var allowExts = "*.pdf; *.xls; *.xlsx; *.rar; *.zip";
  6. $(document).ready(function() {
  7. var is_error = false;
  8. $('#file_upload_50').uploadify({
  9. 'swf': basePath + '/uploadify/uploadify.swf','uploader': "uploader.PHP",'height': 25,'buttonText': "Upload",'fileTypeExts': allowExts,'fileTypeDesc': "Formats:" + allowExts,'formData': {
  10. 'user_id': 50,'company_id': 1
  11. },'onUploadError': function(file,errorCode,errorMsg,errorString) {
  12. alert(errorMessage);
  13. is_error = true;
  14. },'onUploadSuccess': function(file,data,response) {
  15. var result = $.parseJSON(data);
  16. if (!result.result) {
  17. alert(result.error_msg);
  18. is_error = true;
  19. }
  20. },'onQueueComplete': function(queueData) {
  21. if (!is_error) {
  22. document.location.href = "result_page.html";
  23. }
  24. }
  25. });
  26. });
  27. </script>

哪里有问题?你能给我一些建议吗我很无奈谢谢

我发现添加一个setTimeout来修复这个.这表示Chrome / Chrome的Flash实施/ Uploadify的Flash应用程序中的竞争条件,其中的情况并不明确.尽管如此,它似乎在所有情况下都适用于我们的用例.
  1. $(document).ready(function () {
  2. setTimeout(function () {
  3. $('foo').uploadify({...});
  4. },0);
  5. });

这不是一个很好的答案,但是在没有解决方案的情况下,这是一个可用的解决方法.

猜你在找的PHP相关文章