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

Running Swagger UI with jQuery No-conflict #1647

Closed
grantpalin opened this issue Oct 2, 2015 · 5 comments
Closed

Running Swagger UI with jQuery No-conflict #1647

grantpalin opened this issue Oct 2, 2015 · 5 comments

Comments

@grantpalin
Copy link

Swagger UI doesn't work in cases where jQuery is loaded in no-conflict mode - the $ references in swagger-ui.js cause $ is not a function errors. The same setup works when jQuery is loaded normally, but I can't rely on that.

I know that this can be worked around by enclosing the code in a self-executing function and passing in the jQuery object as $, but I'm hesitant to modify dependency code. My other option may be to try running Swagger UI in an iframe, where the parent page setup won't apply.

Please consider updating Swagger UI to work when jQuery is in no-conflict mode.

@osbornk
Copy link

osbornk commented Jan 28, 2016

I would like to see this resolved as well. I did some digging and I believe the problem is in jquery-ba.bbq. We have a custom template that includes jquery 2.1. And that causes the Swagger UI to fail with this error. And jquery-ba.bbq appears to bot work with jquery 2.1 because of removed functions ($.param.fragment is not a function).

@jamesxabregas
Copy link

+1

@jasonyarrington
Copy link

I am working on this too. I want to be able to host this in an app that is using JQuery 2.x in noConflict mode.

The jquery-ba.bbq issue can be worked around by adding jQuery migrate. jQuery migrate will add back in the deprecated methods to support older dependencies like jquery-ba.bbq.

But, I am facing the same enclosure issue. I am going to go ahead and modify it, but +1 for wrapping everything in an enclosure.

@webron
Copy link
Contributor

webron commented Mar 20, 2017

This should be resolved in 3.0. Please reopen otherwise.

@webron webron closed this as completed Mar 20, 2017
@grantpalin
Copy link
Author

Good to know. I worked around the issue by using an iframe to contain the spec.

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

5 participants