Tôi đã tải xuống số sample-project cho số latest-release của RequireJS
. documentation implies bất kỳ thứ gì được tải của chúng được chuyển vào danh sách tham số của hàm liên quan (theo thứ tự tương ứng).Tại sao RequireJS không chuyển jQuery thành bí danh chức năng?
Vì vậy, tôi đã quyết định thử ... nhưng có vẻ như nó không hoạt động!
Firebug
(tab net) cho thấyjQuery
như được nạp: nênRequireJS
obvioulsy đã làm phần đó thành côngFirebug
(giao diện điều khiển tab) show '$ không phải là một chức năng'
Câu hỏi của tôi là : Tại sao không phải là bí danh nhận được dân cư?
MY mã trông như thế:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/require.js" type="text/javascript"></script>
<script type="text/javascript">
require(["scripts/jQuery/Core/jquery-1.7.2.min"], function ($) {
// jQuery is not passed-into the function, so the alias fails!
$(function() {
var stop = "";
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
</form>
</body>
</html>
của họ MẪU trông giống như:
//Inside scripts/main.js
require(["some/module", "a.js", "b.js"], function(someModule) {
//...
});
Bueller? Beuller? –