0

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?

3
  • @Pekka I'm having issues with doing some JQuery stuff on a page and I want to create a popup which can have it's own head and body. I had some issues using iframes which prevented me from achieving the effect I wanted. (see my previous few questions) Commented Feb 14, 2011 at 18:47
  • it's not possible without an iframe, no. Commented Feb 14, 2011 at 18:48
  • Why do you need the head/body elements? Commented Feb 14, 2011 at 20:05

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.