Thanks for quick reply, cool its working absolute fine. And many thanks for having that as plugin.
Ashish Agrawal On Oct 8, 10:28 pm, Bil Corry <[EMAIL PROTECTED]> wrote: > Ashish Agrawal wrote on 10/8/2007 10:26 AM: > > > First one (with document.ready) don't work (at least for me in FF 2). > > But second one works fine as expected. > > Can any one tell me how can I simulate body onload using jQuery? > > This is how I did it. I never tested anything beyond FF2 and IE7, but it > does work for them. > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" > "http://www.w3.org/TR/html4/loose.dtd"> > <html> > <head> > <meta http-equiv="Content-Type" content="text/html; > charset=utf-8"> > <title>Designmode Demo</title> > <script src="jquery-latest.pack.js" > type="text/javascript"></script> > <script language="JavaScript" type="text/javascript"> > jQuery.fn.designmode = function(option) { > var option = option || 'On'; > this.each(function(i){ > if (this) > if (this.contentDocument) > $(this).load( > function() { this.contentDocument.designMode = option; }); // FF2 > else if (this.contentWindow > && this.contentWindow.document) > > this.contentWindow.document.designMode = option; // IE7 > }); > return this; > } > > $(function(){ > $("#edit").designmode(); // turn on designMode > }); > </script> > </head> > <body style="background: white;"> > <iframe id="edit" style="height: 100px; width: 400px; border: > 1px solid black; background: white; overflow: auto; display: inline;"> > </iframe> > </body> > </html> > > - Bil