-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Open
Labels
Description
Q&A (please complete the following information)
OS: Window
Browser: Microsoft Edge
Version: 44.17763.831.0
Swagger-UI version: 3.51.2
Content & configuration
Example Swagger/OpenAPI definition:
<script src="swagger-ui-bundle.js" charset="UTF-8"> </script>
<script src="swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
<script>
window.ui = null;
function loadApplicationList(url, callBackFunction) {
var xhttp;
xhttp=new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
callBackFunction(this);
}
}
xhttp.open("GET", url, true);
xhttp.send();
};
function initSwagger(xhttp){
const ui = SwaggerUIBundle({
urls: JSON.parse(xhttp.responseText),
validatorUrl : false,
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
[})]([url](url))
window.ui = ui;
}
window.onload = [loadApplicationList("apidoc/retrievedoclist",initSwagger);
Describe the bug you're encountering
javascript syntax error - no variable defined at catch block, It's work normal in Chrome browser.
Incorrect syntax: try{}catch{}
Correct syntax: try{}catch(e){}