日期:2014-05-16 浏览次数:20759 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <META HTTP-EQUIV="pragma" CONTENT="no-cache">  
        <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate,no-store">  
        <META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">  
        <META HTTP-EQUIV="expires" CONTENT="0">
        <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> 
        <title>发布商品</title>
        <script type="text/javascript" src="http://www.weddingdress-oem.com/mn/js/jquery.js"></script>
        
        <script type="text/javascript" src="http://www.weddingdress-oem.com/mn/js/jquery.form.js"></script>
        <script type="text/javascript">
            $(document).ready(function(vv){    
                //图片上传
                $("#maolian").click(function(){
                    $("#uimg").click();
                });
                
                $("#uimg").change(function(){
                    var v = ($("#uimg").val());                                    
                    if ($("#uimg").val()){    
                        alert(v);
                        $("#upimgform").ajaxSubmit({
                                //dataType:'script',
                                type:'post',
                                url: "upaimg.php",    
                                beforeSubmit: function(){
                                    $("#maolian").html("图片上传中...");
                                    //$("#yulan").html("");
                                },
                                success: function(data){                    
                                    $("#maolian").html("上传图片");                
                                    $("#yulan").append(data);
                                },
                                resetForm: false,
                                clearForm: false
                        });
                        //$("#upimgform").submit();
                    }
                });
            });
        </script>
    </head>
    <body>
        <form id="upimgform" method="post" enctype="multipart/form-data" action="upaimg.php"> 
        上传图片:<br /><br /><a href="#" id="maolian" name="maolian">本地上传</a><br /><br />
        <input name="uimg" id="uimg" type="file" style="display:none" />
        
        </form>
        <div id="yulan"></div>
    </body>
</html>