#10746 closed bug (invalid)
jQuery1.7 load issue as an AMD module
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | core | Version: | 1.7 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
There is an issue when we try to load jQuery1.7 as an AMD module: <script> use an AMD Loader, then try it: require.config('jquery','http://code.jquery.com/jquery-1.7.min.js'); define.amd.jQuery = {}; require('jquery', function($){
1. alert($); 2. $(document.body).css('color','red');
}); </script>
The result of No.1 is: function (a, b) {
return new e.fn.init(a, b, h);
}
The result of No.2 is: $(document.body).css is not a function
Could you please help to figure it out?
Change History (2)
comment:1 Changed 11 years ago by
Component: | unfiled → core |
---|---|
Priority: | undecided → low |
Resolution: | → invalid |
Status: | new → closed |
comment:2 Changed 11 years ago by
I think this bug is caused by the position of AMD define inside the source code.
After the AMD define, there are a lot of feature definition, so, although the jQuery has been passed to the "require" when the AMD define ran, the callback of require still cannot access the methods which defined after jQuer AMD definition.
Please ask for support on the forums or on the #jquery irc channel.