Skip to main content
WolfShade
Brainiac
August 18, 2020
Answered

Updated jQuery: "r.getClientRects is not a function"

  • August 18, 2020
  • 5 replies
  • 12972 views

Hello, all,

 

I'm trying to update from very old versions of jQuery (like 1.3.x through 1.11.x) and I'm using the latest version, which is v.3.5.1.  I'm getting the error message in the console: r.getClientRects is not a function.  I've been Googling this, and coming up with nothing but "include the migration library".  Well, I've included it, and I'm still getting the error.  Could this be due to old jQuery-UI files?  Or something else?

 

V/r,

 

[Moderator moved from Cold Fusion to Dreamweaver at OP's request.]

 

^ _ ^

This topic has been closed for replies.
Correct answer Nancy OShea

Nancy,

 

I just did a site-wide search for script tags that have 'ui' as part of the src attribute.  71 UI files, 27 of which are custom, 44 are no-theme plain-jane UI files.  Each section of the project has a different color scheme.  If I have to update those, how do I determine the settings?  Or is there an easy way?

 

Thank you, for your insight.

 

V/r,

 

^ _ ^


I would run a test on one project and see if changing jQuery UI helps you or hurts you. 

 

5 replies

WolfShade
WolfShadeAuthor
Brainiac
August 24, 2020

But, I just realized that this brings me back to a question I asked, earlier.

 

For the custom UI files, with different color schemes, how can I get updated UI to match those?

 

V/r,

 

^ _ ^

Nancy OShea
Community Expert
August 24, 2020

Color themes are CSS, not JavaScript files.

 

Nancy O'Shea— Product User, Community Expert & Moderator
WolfShade
WolfShadeAuthor
Brainiac
August 25, 2020

Clearly I am misunderstanding something.

 

When I find a jQuery file named "jquery-ui-1.9.1.custom.min.js", what exactly is 'custom' about it?

 

V/r,

 

^ _ ^

WolfShade
WolfShadeAuthor
Brainiac
August 21, 2020

I gave it a shot.. replaced the old customized UI file with a plain-jane 1.12.1 UI.  It did fix one problem, somewhat.  I'll explain.  (Sadly, I cannot provide a link or a screenshot - this is a restricted portal, and only those with a Common Access Card can view the pages.)

 

The main page of the portal, as well as every sub-section, displays a banner the first time the page loads.  It declares to the user that "You are accessing a USG Informatin System that is for authorized use only" and a bunch of bullet points that the user has to agree to in order to continue.  The only reason we first noticed that there was a problem was because the banner didn't appear on a higher z-index than the rest of the page; rather it was pushed to the bottom of the page, below the footer, and clicking the CONTINUE button did nothing.

 

With the 1.12.1 UI, the banner is appearing on a higher z-index than the content, except for the news captions/images slideshow near the top of the screen.  The images show through the banner.  Any suggestions?

 

Thank you, and V/r,

 

^ _ ^

Nancy OShea
Community Expert
August 21, 2020

What's the z-index of your banner?

Does banner have a 100% solid background?

 

Nancy O'Shea— Product User, Community Expert & Moderator
WolfShade
WolfShadeAuthor
Brainiac
August 24, 2020

Hi, Nancy,

 

I don't know what made me think of it, but I cleared the browser cache and the problem disappeared.  smh

 

So, I created a txt file with links to instructions for clearing the cache of the four bigs (FireFox, Chrome, IE, Edge) and sent it to our SA, just in case there's a bunch of people who flip out on the pre-cleared version; we can get the instructions out, quickly.

 

Don't know _why_ that fixed it.. I've given up, anymore.  But, thank you for your time and wisdom.

 

V/r,

 

^ _ ^

WolfShade
WolfShadeAuthor
Brainiac
August 20, 2020

Nancy,

 

We are not allowed to use CDNs for sources.  If I go to the URL for the 1.12.1 UI and save that as a .js file, will that be enough?

 

V/r,

 

^ _ ^

Nancy OShea
Community Expert
August 20, 2020

Go here:

https://code.jquery.com/ui/1.12.1/jquery-ui.min.js

 

Ctrl + A to select all.

Ctrl + C to copy.

File > New > JavaScript > Create button.

Ctrl + V to paste.

Ctrl + S to save.

Close file.

Open parent document.

Insert > HTML > Script...

 

Nancy O'Shea— Product User, Community Expert & Moderator
Nancy OShea
Community Expert
August 20, 2020

Thank you for the detailed steps.  But I should have been more specific in my query.

 

Will including a local copy of the .js file be sufficient?  OR, does the UI on the CDN need access to other files on the CDN that I will also need to copy and include locally?

 

V/r,

 

^ _ ^


The core library doesn't make calls to other scripts.  You need a minified jQuery UI js + whatever theme you're using.

base black-tie blitzer cupertino dark-hive dot-luv eggplant excite-bike flick hot-sneaks humanity le-frog mint-choc overcast pepper-grinder redmond smoothness south-street start sunny swanky-purse trontastic ui-darkness ui-lightness vader

 

Nancy O'Shea— Product User, Community Expert & Moderator
WolfShade
WolfShadeAuthor
Brainiac
August 19, 2020

Hi, Nancy,

 

Unfortunately, we will never know.  Recent scans and external security reports show vulnerabilities in versions of jQuery earlier than v3.5.0, so the USG will not consider rolling back to v2.x.  I'm just trying to find a way to update the code to match with the updated jQuery, but the error messages are not very helpful, even with the uncompressed development migration library.  I keep getting this feeling like it's got to do with the jQuery-UI files, but can't find anything on Google indicating as much.

 

V/r,

 

^ _ ^

Nancy OShea
Community Expert
August 19, 2020

Which jQuery UI build are you using?

https://code.jquery.com/ui/

 

The last jQuery UI (1.12) came out 4 years ago.  

https://jqueryui.com/changelog/1.12.0/

 

Nancy O'Shea— Product User, Community Expert & Moderator
WolfShade
WolfShadeAuthor
Brainiac
August 19, 2020

Doing a project-wide search for 'jquery' and picking out just ones that include 'ui', I see a wide range of UI includes:

1.9.1.custom
1.8.rc2
1.7
fancybox.1.3.1
1.8.16.custom

.. and others.  Doesn't look like any of them are 1.12.  Could updating all of them help?  idk.. There are 227 instances of the word 'jquery' in the search results.

 

V/r,

 

^ _ ^

Nancy OShea
Community Expert
August 19, 2020

What happens if you roll back to jQuery core 2?

 

Nancy O'Shea— Product User, Community Expert & Moderator