首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Ajax >

ajaxfileupload jquery.window('open')有关问题

2013-03-01 
ajaxfileupload jquery.window('open')问题在ie里$(#progress).window(open)没起作用,在火

ajaxfileupload jquery.window('open')问题
在ie里$('#progress').window('open')没起作用,在火狐里没压力,希望高手们看看,代码如下:

function ajaxFileUpload(){
 if($('#image').attr("value")!=""){
 
 $.ajaxFileUpload(
                   {
                url:'newsFileUpload.jsp?t='+new Date(),            //需要链接到服务器地址
                secureuri:false,
                fileElementId:'image',                        //文件选择框的id属性
                dataType: 'json',                                     //服务器返回的格式,可以是json
                success: function (data, status)            //相当于java中try语句块的用法
                {     
                   //var json  = JSON.parse(data)
                   if(data.success!=true){
                   $.messager.alert('注意',"数据处理出错,请重新上传",'warning');
                   }
                },
                error: function (data, status, e)            //相当于java中catch语句块的用法
                {
                   $.messager.alert('错误',"错误:"+e.description,'error');
                }
            }
                  
               );
               $('#progress').window('open');
               var flag;
               do{
               $.ajax({
                 type:"POST",
                 async:false,


                 url:"newsUploadProgress.jsp?t=" +new Date(),
                 dataType:"json",
                 cache:false,
                 timeout:4000,
                 success:function(data){
                    //alert(data);
                    //var json  = JSON.parse(data);
                    flag=data.percentage;
                    $('#p').progressbar('setValue', flag*100);
                    $('#message').html(data.msg);
                 }
             });
               }while(flag<1)
               $('#progress').window('close');
               return false;
 }else{
 $.messager.alert('错误',"新闻列表文件不能为空",'error'); 
 }
               
             
          }

ajaxfileupload jquery.window
[解决办法]
$('#progress').window('open');提到ajaxfileupload前面不就行了

ajaxfileupload是异步,应该不会阻塞$('#progress').window('open');执行

热点排行