require.js配置后不能正常使用
<!doctype?html> <html> <head> <meta?charset="UTF-8"> <title>Document</title> </head> <body> <script?type="text/javascript"?src="js/require.js"?data-main="js/main.js"></script> </body> </html>
以上是index.html
require.config( { paths:{ jquery:?'jquery-1.11.3.min' } } ); require(['jquery'],function($){ alert($().jquery); });
以上是main.js
打開(kāi)index.html,沒(méi)有彈出版本號(hào)。