Answer the question
In order to leave comments, you need to log in
How to properly edit a script in yii2?
Faced a problem. There is a BackendAsset, the app.js script is connected in it. The code:
class BackendAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
'css/style.css'
];
public $js = [
'js/app.js'
];
public $depends = [
'yii\web\YiiAsset',
'common\assets\AdminLte',
'common\assets\Html5shiv'
];
}
Uncaught SyntaxError: Invalid or unexpected token
$(function() {
"use strict";
//Make the dashboard widgets sortable Using jquery UI
$(".connectedSortable").sortable({
placeholder: "sort-highlight",
connectWith: ".connectedSortable",
handle: ".box-header, .nav-tabs",
forcePlaceholderSize: true,
zIndex: 999999
}).disableSelection();
$(".connectedSortable .box-header, .connectedSortable .nav-tabs-custom").css("cursor", "move");
})����������������������������������������������������������������������������������������������������������������
Answer the question
In order to leave comments, you need to log in
assets have nothing to do with it. The problem is that you saved the file with the wrong encoding when editing. Just open the file again, add your code and save in the desired encoding.
As an option - it's the wonders of your editor. Try to open in another and save again.
Attention!!! Be sure to clear the assets folder. And check which encoding for yii and for the server are set.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question