how to preview an image before upload in various browsers

后端 未结 5 991
遥遥无期
遥遥无期 2020-12-29 15:25

I want to show preview of an image before it is uploaded. I have found a partial solution that works for ie6 and firefox, and havent yet tested it in ie7 or ie8. But i want

5条回答
  •  醉梦人生
    2020-12-29 16:12

    jquery ajax file upload

    $('[name="send"]').click(function(){
    
       view();
    
       v_data = {
                    news_header : $('[name="news_header"]').val(),
                    news_auth : $('[name="news_auth"]').val(),
                    news_image : image, //this var taking for view() function what i use before
                    news_news : $('[name="news_news"]').val()    
    
                };
    
       $("#show").html(v_data.news_Header + " " + v_data.news_auth + " "+ v_data.news_image + " "+ v_data.news_news );
    
       $.ajax({
            type    :   "POST",
            url     :   './insert_news_data.php',
            enctype: 'multipart/form-data',        
            data    :   v_data,
    
            success: function(data) {
                alert(data);
            }
       });
    
    
    });
    

提交回复
热议问题