我有这个问题我正试图从js文件中调用一个函数但是收到错误“Uncaught ReferenceError:hello is not defined”
<?php
//Note: This code is within a view file (this view file also uses js code from js/details.js)
$script = <<< JS
$(document).ready(function(){
hello();
});
JS;
$this->registerJs($script);
?>
//Note This code is in an external js file (js/cart.js)
function hello(){
console.log('hello');
}
我在考虑它的层次结构问题,所以我将cart.js放在我的资产文件中,但仍然无法使其正常工作,任何帮助都将被应用
我正在编辑并添加我的控制台broswer的新img