Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tested latest development jQuery, breaks a plugin #2460

Closed
energyuser opened this issue Jul 8, 2015 · 11 comments
Closed

Tested latest development jQuery, breaks a plugin #2460

energyuser opened this issue Jul 8, 2015 · 11 comments

Comments

@energyuser
Copy link

So I tested the latest development version of jQuery (this one: https://code.jquery.com/jquery-git.js). So it appears that this breaks the following plugin: https://github.com/cameronmcefee/plax
This is just a bug report so that you guys can look into the error Firefox threw at me:
TypeError: elem.getClientRects is not a function --File and Line/Column-- jquery.js:9372:8
Still, is that a bug in jQuery or is it with the plugin? It works with http://code.jquery.com/jquery-2.1.4.min.js so this leads me to believe you broke something in the late revisions.

@timmywil
Copy link
Member

timmywil commented Jul 8, 2015

Thanks for opening an issue. Please provide a small but complete test case from http://jsbin.com to help us asses the issue. Firefox supports getClientRects on elements, so my guess is there's some invalid input here.

@dmethvin
Copy link
Member

dmethvin commented Jul 8, 2015

If it helps to create your test case, that error is being thrown from .offset(). Mostly likely some element in the jQuery collection is either not a DOM element (e.g. a window or document) or not currently connected to the document. These have always been invalid inputs but just didn't throw errors in the past.

@energyuser
Copy link
Author

@timmywil that is an example of how I use the plugin: http://codepen.io/anon/pen/MwGgxy just move the mouse and you'll see that this works because it uses jQuery 2.1.4. Click settings to see the scripts I used in the <head>.
Want an example that uses the dev version? I tested in latest FF IE and Chrome and no luck so far...

@dmethvin
Copy link
Member

dmethvin commented Jul 8, 2015

In Chrome I get this:
Refused to execute script from 'https://raw.githubusercontent.com/cameronmcefee/plax/master/js/plax.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.

@energyuser
Copy link
Author

@dmethvin There. I fixed it for Chrome. Try the link again.

@mgol
Copy link
Member

mgol commented Jul 8, 2015

You can just use rawgithub.com

Michał Gołębiowski

@energyuser
Copy link
Author

@mzgol Thanks, didn't know that, updated the pen
guys any progress so far?

@dmethvin
Copy link
Member

dmethvin commented Jul 8, 2015

My guess above was right, the plugin is asking for $(window).offset() which makes no sense. It should use { left: 0, top: 0 } if there is no element.

@energyuser
Copy link
Author

@dmethvin So I should change a code portion in the plugin so that it works? Could you provide some assistance?

@dmethvin
Copy link
Member

dmethvin commented Jul 8, 2015

If the author isn't developing the plugin anymore, I'd recommend finding an actively developed one. I'm glad you pointed out this problem though, it's nice that people are trying the bleeding-edge builds with their code. That's how we can find out what we break!

@ned2
Copy link

ned2 commented Oct 12, 2015

Also worth noting that this issue of a Window being in the jQuery collection that offset() is being called on currently breaks some jQuery-UI code, but has been fixed in the master branch: jquery/jquery-ui@b3a9b13

@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

5 participants