You can theoretically do it, but you'll run into problems right away in IE when you create a node in one document and try to append it in another; plus I'd figure it's not as straightforward, having to do things like $.fn.apply(blah blah) instead of the regular sweet syntax.

I wouldn't bother.

cheers
-francisco

On 10/19/06, Blair McKenzie <[EMAIL PROTECTED]> wrote:
That's what I've done. It may be possible to do it another way, but I haven't had the time to experiment.


Blair

On 10/19/06, Jacky < [EMAIL PROTECTED]> wrote:
So, I should:
1. includes jQuery library in popup.
2. call ref.$()
where ref is the window reference created in window.open?

On 10/19/06, Blair McKenzie < [EMAIL PROTECTED]> wrote:
> The only way I know of to use jQuery in another window/frame is to include
> jquery in that page's html, and then access it using window.$().
>
> Blair
>
>
> On 10/19/06, Jacky < [EMAIL PROTECTED]> wrote:
> >
> > I have tried to directly use the window reference.
> > i.e.
> > var abc = ref.document.getElementById("abc1");
> > abc.parentNode.removeChild(abc);
> >
> > The result is correct that the input box in popup windows being removed.
> > Seems that jQuery cannot use popup window reference?
> >
> > On 10/17/06, Jacky < [EMAIL PROTECTED]> wrote:
> > > Dear all,
> > >
> > > I would like to make a simple popup which would copy current page
> > > content and do some conversion ( e.g. text box to text). But I have met
> > > a problem of getting a wrong reference. Here is the code to
> > > demonstrate the problem:
> > >
> > > <html>
> > >         <head>
> > >                 <title>Test Popup</title>
> > >                 <script type="text/_javascript_" src="" jquery.js"></script>
> > >                 <script type="text/_javascript_">
> > >                         $(document).ready(function(){
> > >
> $("#popup").click(specificPop);
> > >
> > >                                 function specificPop(){
> > >                                         var ref =
> genericPopup();
> > >
> $(ref.document ).find("#popup_body #abc1").remove();
> > >                                 }
> > >
> > >                                 function
> genericPopup(){
> > >                                         var ref =
> window.open('','','resizable=1,width=400,height=400');
> > >                                         var diva =
> $("#diva").clone();
> > >
> ref.document.open();
> > >
> ref.document.write('<html><head><title>Popup</title></head>');
> > >
> ref.document.write ('<body id="popup_body">');
> > >
> ref.document.write($(diva).html());
> > >
> ref.document.write('</body></html>');
> > >
> ref.document.close();
> > >                                         return ref;
> > >                                 }
> > >                         });
> > >                 </script>
> > >         </head>
> > >         <body>
> > >                 <div id="diva">
> > >                         <input type="text" id="abc1" value="111"/>
> > >                         <input type="text" id="abc2" value="222"/>
> > >                 </div>
> > >                 <a href="" id="popup">popup</a>
> > >         </body>
> > > </html>
> > >
> > > In this example, I would expect the text box #abc1 in the popup is
> > > removed. But it removes current window's one instead. For the removal
> > > code, I have tried the following approaches:
> > >
> > > $(ref.document).find("#abc1").remove();
> > > $(ref.document).find("#popup_body #abc1").remove();
> > > $("#popup_body #abc1",ref.document ).remove();
> > > $(ref.document ).find("#popup_body #abc1",ref.document).remove();
> > >
> > > but all failed. Any idea how can I can the correct reference??
> > >
> > > P.S. using jQ ver 1.0.2
> > > --
> > > Best Regards,
> > > Jacky
> > > http://jacky.seezone.net
> > >
> >
> >
> >
> > --
> > Best Regards,
> > Jacky
> > 網絡暴民 http://jacky.seezone.net
> >
> > _______________________________________________
> > jQuery mailing list
> > discuss@jquery.com
> > http://jquery.com/discuss/
> >
>
>
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>
>
>


--
Best Regards,
Jacky
網絡暴民 http://jacky.seezone.net

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Francisco Brito

software:            http://nullisnull.blogspot.com
photography:           http://www.flickr.com/photos/darkgoyle
everything else:   http://brito.mindsay.com
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to