error in yii 1 with js files

1

download a system that they use in the company which works well in the production server but when you download it to local all js files mark this error Uncaught SyntaxError: Invalid or unexpected token I have reviewed the url and it is ok not to that it is because is loading jquery correctly.

<!-- momentjs -->
<script src="<?php echo Yii::app()->baseUrl; ?>/js/moment-with-locales.min.js"></script>
<!-- datepicker -->
<script src="<?php echo Yii::app()->baseUrl; ?>/js/bootstrap-datetimepicker.min.js"></script>

<!-- Bootstrap 3.3.6 -->
<script src="themes/adminlte/bootstrap/js/bootstrap.min.js"></script>
<!-- fineuploader 5.10.1 -->
<script src="themes/adminlte/js/jquery.fine-uploader/jquery.fine-uploader.min.js"></script>
<script>
    $('#fine-uploader-gallery').fineUploader({
        template: 'qq-template-gallery',
        debug: true,
        request: {
            endpoint: '<?=$this->createUrl('/cruge/ui/uploadphoto');?>',
            //inputName: 'CrugeStoredUser[user_picture]'
        },
        thumbnails: {
            placeholders: {
                waitingPath: './images/waiting-generic.png',
                notAvailablePath: './images/not_available-generic.png'
            }
        },
        validation: {
            allowedExtensions: ['jpeg', 'jpg', 'gif', 'png']
        },
        callbacks: {
          onComplete: function (id, name, responseJSON, xhr) {
            var src = $('[qq-file-id='+id+']').find('.qq-thumbnail-selector').attr('src');
            $('.usrPic').attr('src', src);
          }
        }
    });
</script>
<!-- AdminLTE App -->
<script src="themes/adminlte/dist/js/app.min.js"></script>
<!-- Optionally, you can add Slimscroll and FastClick plugins.
     Both of these plugins are recommended to enhance the
     user experience. Slimscroll is required when using the
     fixed layout. -->

     <script type="text/javascript">
            $(function () {
                $('#task_fecha_task').datetimepicker({
                  format: 'YYYY-MM-DD HH:m:ss'
                });
            });
        </script>
    
asked by Andersson Meza Andrade 31.01.2018 в 22:05
source

1 answer

0

I think the problem is this:

'<?=$this->createUrl('/cruge/ui/uploadphoto');?>'

And it should be:

"<?=$this->createUrl('/cruge/ui/uploadphoto');?>"

Normally that problem usually occurs when there are some incorrectly placed quotes.

    
answered by 02.02.2018 в 18:17