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?
-
@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)Skizit– Skizit2011-02-14 18:47:48 +00:00Commented Feb 14, 2011 at 18:47
-
it's not possible without an iframe, no.Pekka– Pekka2011-02-14 18:48:55 +00:00Commented Feb 14, 2011 at 18:48
-
Why do you need the head/body elements?Bobby Jack– Bobby Jack2011-02-14 20:05:41 +00:00Commented Feb 14, 2011 at 20:05
2 Answers
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.