Opened 2 years ago

Last modified 2 years ago

#16963 new defect (bug)

wp_enqueue_script bug in ie8

Reported by: jkmassel Owned by:
Priority: normal Milestone: Awaiting Review
Component: External Libraries Version: 3.1
Severity: normal Keywords: needs-patch
Cc:

Description

In IE 8, if you enqueue jQuery and scriptaculous, the prototype library will be included before jQuery. Because of this, jQuery will overwrite the $ method, and even though it runs noConflict() the variable is broken for both libraries. WP should be aware of this and sort the libraries for this situation. (jQuery should be first, then prototype)

Tested on WP 3.1 in IE 8 build 8.0.7601.17514

Change History (6)

wp_prototype_before_jquery() seems to indicate that the proper loading order is prototype, then jQuery.

indeed. and that does seem logical, but that order breaks in ie8. This seems to be a somewhat common issue. Quick google search: http://stackoverflow.com/questions/2830510/jquery-noconflict-not-working-in-ie8-only

Are you overriding jQuery with an earlier version?

comment:4 follow-up: ↓ 5   jkmassel2 years ago

No, calling wp_enqueue_script('jquery') alone should always return the latest (1.4.4 in 3.1), correct? There are no plugins or methods to change the version.

comment:5 in reply to: ↑ 4   ramoonus2 years ago

Replying to jkmassel:

No, calling wp_enqueue_script('jquery') alone should always return the latest (1.4.4 in 3.1), correct? There are no plugins or methods to change the version.

incorrect

Poor wording on my part. It returns nothing, but it *should* enqueue the most recent version of jQuery, unless otherwise specified or overridden?

Note: See TracTickets for help on using tickets.