RT
比如我现在有input来上传文件,文件格式必须是js的,
如何写js程序,最后将上传好的文件列成表格谢谢大家。

解决方案 »

  1.   

    <!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=gb2312" />
    <title>无标题文档</title>
    <script type="text/javascript">
    function check(a){
    alert(a.value);
    }
    </script>
    </head><body>
    <input type="file" onchange="check(this)">
    </body>
    </html>
    这个一般都放在后台的
      

  2.   


    var FormFileUpload = function () {
        return {
            //main function to initiate the module
            init: function () {            // Initialize the jQuery File Upload widget:
                $('#fileupload').fileupload({
                    // Uncomment the following to send cross-domain cookies:
                    //xhrFields: {withCredentials: true},
                    url: '../../assets/plugins/jquery-file-upload/server/php/'
                });            // Load existing files:
                // Demo settings:
                $.ajax({
                    // Uncomment the following to send cross-domain cookies:
                    //xhrFields: {withCredentials: true},
                    url: $('#fileupload').fileupload('option', 'url'),
                    dataType: 'json',
                    context: $('#fileupload')[0],
                    maxFileSize: 5000000,
                    acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
                    process: [{
                            action: 'load',
                            fileTypes: /^image\/(gif|jpeg|png)$/,
                            maxFileSize: 20000000 // 20MB
                        }, {
                            action: 'resize',
                            maxWidth: 1440,
                            maxHeight: 900
                        }, {
                            action: 'save'
                        }
                    ]
                }).done(function (result) {
                    $(this).fileupload('option', 'done')
                        .call(this, null, {
                        result: result
                    });
                });            // Upload server status check for browsers with CORS support:
                if ($.support.cors) {
                    $.ajax({
                        url: '../../assets/plugins/jquery-file-upload/server/php/',
                        type: 'HEAD'
                    }).fail(function () {
                        $('<span class="alert alert-error"/>')
                            .text('Upload server currently unavailable - ' +
                            new Date())
                            .appendTo('#fileupload');
                    });
                }            // initialize uniform checkboxes  
               
            }    };}();
      

  3.   


    有个问题,我如何将一个网页中input的直,在下一个网页中显示????
      

  4.   


    有个问题,我如何将一个网页中input的直,在下一个网页中显示????
    1.用表单提交
    2.url参数
    3.作用域:session,cookie
      

  5.   

    是在第一个页面中input导入文件,进入第二个页面,只显示文件名和文件格式,进入第三个页面,导入文件内容。我现在遇到的问题是,第二个页面要摸就显示文件名和格式,通过url来显示。但是第三也需要整个文件路径才能显示文件内容。但是如果现实文件绝对路径,路经会出现fakepath在路经中。这是我现在的问题。请教大虾。