我最近下载了require.js 2.0,我的控制台出错了:
Uncaught TypeError: Object function (){var g=ga.call(arguments,0),e;if(f&&v(e=g[g.length-1]))e.__requireJsBuild=!0;g.push(d);return b.apply(null,g)} has no method 'nameToUrl'
Run Code Online (Sandbox Code Playgroud)
requirejs是否仍然支持order.js插件?我没有在网站上看到它的文档.
当我尝试删除文件时,脚本会中断.
在我的索引文件中,我在head部分包含了requirejs脚本:
<!DOCTYPE html>
<html>
<head>
<title>
My Mobile Application
</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<link rel="stylesheet" href="public/css/style.css" />
<script data-main="scripts/main.js" src="scripts/require.js"></script>
</head>
<body></body>
</html>
Run Code Online (Sandbox Code Playgroud)
然后在我的main.js文件中:
requirejs.config({
//By default load any module IDs from js/lib
baseUrl: 'js/lib',
//except, if the module ID starts with "app",
//load it from the js/app directory. paths
//config is relative to the baseUrl, and
//never includes a ".js" extension since …Run Code Online (Sandbox Code Playgroud)