Skizit
Skizit

Reputation: 44862

JQuery UI question

I'm using a JQuery UI dialog and I'm wondering is it possible for me to define the dialog it's own <head> and <body> elements independant of that on the page while still remaining "the one page" if not, how else could I achieve this?

Upvotes: 0

Views: 58

Answers (2)

jfrobishow
jfrobishow

Reputation: 2895

A jQuery UI dialog is just another DOM element. It simply add a div to the document window, so no you can't have another body or head tag in it. If you choose to output it anyway, it will show up but likely will not behave how you expect it would.

For example, the following output is invalid, which is exactly what you would get using jQueryUI.

<html>
    <head></head>
    <body>
        <div id="dialog">
            <head></head>
            <body> content </body>
        </div>

    </body>
</html>

What is it exactly that requires you to include another head tag? I am guessing you are trying to load a script asynchronously, if so there are many other ways to do that.

If you want a totally separate document, you can use an iframe in your dialog to achieve the same kind of effect.

Upvotes: 0

Chris Baker
Chris Baker

Reputation: 50612

If your goal is strictly cosmetic, I am not certain what benefit there would be in using head and body tags rather than section or div tags. There is only one body per document, and there is only one head per document.

Upvotes: 1

Related Questions