Please correct me if I am wrong as I am no expert, but I don't think
there is anything particularly about new windows and such in jQuery,
but just regular JavaScript and being able to set the context of the
jQuery selector  method makes it a little easier.

For example:
http://jsbin.com/ibiha
[Code-ish]
<html>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/jquery/1.3/jquery.min.js"></script>
        <script type="text/javascript">
                $(function() {
                        $("#demo_button").click(function(e) {
                                myWindow=window.open
('','MyNewWindow','width=200,height=100,left=200,top=100');
                                myWindow.document.write('<!DOCTYPE HTML PUBLIC 
"-//W3C//DTD HTML
4.01//EN" "http://www.w3.org/TR/html4/strict.dtd";><html xmlns="http://
www.w3.org/1999/xhtml"><head><title>I am a new Window!</title></
head><body><h2>This is a Heading</h2><p>Here is a paragraph tag full
of nonsense and tomfoolery.</p></body></html>');
                                myWindow.document.close();
                                $('h2', myWindow.document).css('color', 'red');
                                $(".demo").append('<div><input type="button"
id="affect_new_window" value="Now click me"/></div>');
                                $('#affect_new_window').click(function(e) {
                                        $('p', myWindow.document).text('See the 
text changed, isn\'t that
neat!');
                                });
                        });
                });
        </script>
</head>
<body>
        <div class="demo">
                <input type="button" id="demo_button" value="Click Me"/>
        </div><!-- End demo -->
</body>
</html>
[/code]

Setting the context of the Selector to the new windows document is
really easy and makes editing the new window with jQuery a breeze.
Anyway I hope the example is helpful.

- BigAB

On May 25, 1:18 pm, GravyFace <gravyf...@gmail.com> wrote:
> On Mon, May 25, 2009 at 3:07 PM, Caires Vinicius <caire...@gmail.com> wrote:
> > The contente of new window opened is dynamically generated? Or is html u
> > already have it?
>
> dynamically-generated.

Reply via email to