This is a conceptual step-by-step description of the process:
- Create a hidden IFRAME in the main page.
- Define a callback function in the main page that will receive the results of the transformation. This callback function will have to insert the transformation results into the main page’s HTML/DOM structure.
- When you need to download additional content, set the IFRAME.href attribute to the URL of the dynamic content.
You should use a timeout in the main page to capture failed loads of the dynamic content. The timeout code should display an error message and kill the download process in IFRAME by resetting the IFRAME.href attribute.
- The dynamic content loaded into the IFRAME should have XML MIME type and contain the xml-stylesheet processing instruction. This will cause the browser to perform XSLT transformation on the XML data.
Alternatively, you can use the onload handler in the IFRAME element to call the callback function.