【发布时间】:2017-12-15 07:57:49
【问题描述】:
当我在 phtml 文件中使用 jQuery 时,我在控制台中收到错误消息“未捕获的 ReferenceError:未定义要求”。 我的 jQuery 代码是
<script type="text/javascript">
require(['jquery', 'jquery/ui'], function($){
alert("Hello world");
});
</script>
提前谢谢...!
【问题讨论】:
-
我不明白@ventiseis
-
require不是标准的js函数。 There seems to be another way to include libs in magento,但我肯定不是magento专家。 此外,alert不需要jquery。你到底想做什么?
标签: php jquery requirejs magento2