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

use jQuery noConflict() or avoid $ - whichever is best #6

Open
richard-jones opened this issue Dec 13, 2017 · 0 comments
Open

use jQuery noConflict() or avoid $ - whichever is best #6

richard-jones opened this issue Dec 13, 2017 · 0 comments

Comments

@richard-jones
Copy link
Member

For embedding Edges in 3rd party sites, we'll need to think a bit more carefully about how we use $. Some sites don't automatically set this to jQuery, and others use a noConflict mode, so $ can't always be relied upon to be there, and can sometimes also disappear at random if another library calls $.noConflict.

Not sure what the best solution is right now. Workaround is

jQuery(document).ready(function($) {
    window.$||(window.$=jQuery);
    // start up your edges
}

Provided this doesn't mess with the site's existing $

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

No branches or pull requests

1 participant