-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Comments
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). |
+1 |
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. |
This should be resolved in 3.0. Please reopen otherwise. |
Good to know. I worked around the issue by using an iframe to contain the spec. |
Swagger UI doesn't work in cases where jQuery is loaded in no-conflict mode - the
$
references inswagger-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.
The text was updated successfully, but these errors were encountered: