The following relies on functionality built in to modern browsers and is unsupported by Internet Explorer versions 6 and 7.With a couple of small changes, you can optimize your dynamic content so it loads asynchronously after the rest of the page has loaded.
- Place <div> elements where you would like the dynamic content to appear on the page.
- Specify a data-dc-url="[URL for your dynamic content]" attribute.
- You'll also want to style those div elements to have the same width and height as the content that will be dynamically inserted so the layout does not have to reflow when the dynamic content is added to the page. Example:
- Then, add the following script (jQuery is required on the page):