I am transforming a site using Moovweb. On one of the pages I want includes content from a seperate page/url. I just want to include partial content. Presently I have two options in mind:
- Achieve this using AJAX, but this requires new content to be loaded once the page has loaded. The content doesn't appear to be on the page or in the source.
- I include an iframe with the new URL and retrieve the content using javascript once the page has loaded.
Both the above options would require parsing and manipulating the DOM once the page has loaded. Is there any way to do it using tritium so that the content is already a part of the page.
iframe: If the content is from your site (www.yoursite.com/anotherpage.html), then yes you can transform it, by creating a special ts file for "anotherpage.html" and doing the transformations there. But as far as I know you cannot touch iframed 3rd party content (www.anothersite.com) in any way. You --might-- be able to style the new content with css, but thats something you'll just have to try.
AJAX: You can transform lateload content using CSS Animations and Javascript. Whatever you do don't use MutationObservers or DOMNodeInserted. Bad for pageload speed on mobile and old versions of IE and Android don't even recognize it.