Просмотр поста #91007: Процесс загрузки

.
Macabre
Wap Master

Спасибо, ток не могу правильно прописать код, пишу в шапке следующее:

echo'<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
    <script src="http://malsup.github.io/jquery.form.js"></script>
    <script>';
        $(document).ready(function() {
            $('#file').on('change', function() {
                $('#form').submit();
            });
            $('#form').submit(function() {
                var progress = $('#progress');
                $(this).ajaxSubmit({
                    beforeSend: function() {
                        $('#result').fadeIn(1000);
                        $('#form').fadeOut(100);
                    },
                    uploadProgress: function(event, position, total, percent) {
                        progress.attr('value', percent);
                        $('#progress-text').attr('data-progress', function() {
                            if(percent == 100) {
                                return 'Файл загружен';
                            }
                            return percent+'%';
                        });
                    }
                });
                return false;
            });
        });
   echo' </script>';

Открывается белая страница...