HTML Snippet embedded with Java Script
Even on a static website there is always content that changes regularly and can be loaded from a database or a web service, for example. OpenEndpoints is perfect for converting external content into HTML, which can be seamlessly integrated into your own website.
HTML Sniplets
Build an Endpoint to Return XSLT Transformation. Do not use the download-filename
attribute in this case.
The generated HTML is inserted directly into the <div>. Therefore, the HTML (generated with XSLT) should not contain a <head> or <body> tag, but actually only the content that is to be inserted!
Set content-type "text/html" in the transformer:
Load Snippet into Web Page
Java Script can be used to load the html returned from the endpoint into a <div>
.
In this example the script was taken from https://www.w3schools.com/lib/w3.js.
Last updated