I would suggest using the frameready plugin, but it appears the authors site was been removed from the internet.
You can download it from here: http://jakemcgraw.com/javascript/jquery.frameready.js Usage instructions are included in the script comments. - jake On Thu, Apr 10, 2008 at 12:25 PM, Jeffrey Kretz <[EMAIL PROTECTED]> wrote: > > I've successfully used jquery by referring to the parent frame. > > Instead of "this", try "document" > > alert($("#mycontent", document).html()); > > JK > > > -----Original Message----- > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On > Behalf Of Frederic > Sent: Thursday, April 10, 2008 5:52 AM > To: jQuery (English) > Subject: [jQuery] Using Jquery instance in an Iframe > > > Hello, > To avoid the loading of multiple Jquery in my application using > Iframe, I would know if anybody has succeeded in using a single Jquery > instance (in the same domain name). > > myexample.html > ------------------------ > <html> > <head><script type="text/javascript" src="jquery.js"></script></head> > <body> > <div id="myparent">Hello world!</div> > <iframe id="myiframe" name="myiframe" src="myiframe.html"/> > </body> > </html> > > myiframe.html > -------------------- > <html> > <head> > <script> > var $ = window.parent.$; > var jQuery = window.parent.jQuery; > $().ready(function() { > alert('jquery loaded in iframe'); > alert($("#myparent", parent.document).html()); > alert($("#mycontent", this).html()); > }); > </script> > </head><body><div id="mycontent">Working in iframe !</div></body></ > html> > > > When executing myexample.html : > => alert box #1 : "jquery loaded in iframe" > => alert box #2 : "Hello world!" > => alert box #3 : null <=== must be "Working in iframe !" > > Any idea on a solution ? > regards > Frederic > >