Skip to content

fix: replace $.isFunction with typeof for jQuery 3.3+ compatibility#164

Open
foodlz wants to merge 1 commit intomalsup:masterfrom
foodlz:patch-1
Open

fix: replace $.isFunction with typeof for jQuery 3.3+ compatibility#164
foodlz wants to merge 1 commit intomalsup:masterfrom
foodlz:patch-1

Conversation

@foodlz
Copy link
Copy Markdown

@foodlz foodlz commented Apr 3, 2026

Uncaught TypeError: $.isFunction is not a function

Fix

Replace the single usage on line 29 with a direct typeof check:

// Before
var setExpr = $.isFunction( document.createElement('div').style.setExpression );

// After
var setExpr = (typeof document.createElement('div').style.setExpression === 'function');


$.isFunction(x) was always just an alias for typeof x === 'function' internally, so this is a drop-in replacement with identical behaviour across jQuery 1.x, 2.x, 3.x, and 4.x. ``````

$.isFunction() was removed in jQuery 3.3. Replace the single usage in
setExpr detection with an equivalent typeof === 'function' check, which
works identically across jQuery 1.x, 2.x, 3.x, and 4.x.
Copilot AI review requested due to automatic review settings April 3, 2026 16:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the BlockUI plugin to avoid relying on $.isFunction, improving compatibility with jQuery builds/versions where that helper is not present (as described by the reported runtime error).

Changes:

  • Replaced the $.isFunction(...) feature-detection check with a direct typeof ... === 'function' check for style.setExpression.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants