Skip to content

Javascript syntax error on Edge 44.x #7468

@Silentwong

Description

@Silentwong

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);
</script>

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){}

Screenshots

image

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions