Across my application, I need to load a content block into a jQuery UI dialog. Each content block must be CSS-styled individually.
I can only think of two solutions, neither of which is ideal:
- Use
jQuery.load()to load a partial HTML page (i.e. no<head>or<body>tags) containing the content block inside the dialog. The external CSS file would then dynamically be appended using jQuery. The dialog can automatically resize to fit the content. - Use an iframe to load an entire page, which contains the content block and the external CSS references all in one page. But the dialog can't automatically resize.
Are there any better solutions?