Bug Tracker

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#10746 closed bug (invalid)

jQuery1.7 load issue as an AMD module

Reported by: [email protected] Owned by:
Priority: low Milestone: None
Component: core Version: 1.7
Keywords: Cc:
Blocked by: Blocking:


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 timmywil

Component: unfiledcore
Priority: undecidedlow
Resolution: invalid
Status: newclosed

Please ask for support on the forums or on the #jquery irc channel.

comment:2 Changed 11 years ago by anonymous

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.

Note: See TracTickets for help on using tickets.