(1) replace "text/xml" with "application/xml" in the geoserver rest api calls so it can work with GS v2.17.1 (2) add additional datalayer name check in utils.addDefaultStyleToDataLayer (3) r v4.0.0 tested
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.