jQuery: The Write Less, Do More JavaScript Library

document.ready firing too early within iframe

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

document.ready firing too early within iframe

by weepy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi

Im trying out the new document ready code from SVN.

I am finding that when my page is within an iframe, document ready
fires at the wrong point in IE7.

IE6 and firefox work fine. IE7 worked ok with the old document ready
code (e.g. 1.2)

Any ideas how to fix this

Sorry for the lack of punctuation im writing this on a danish
keyboard !!

jonah


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: document.ready firing too early within iframe

by John Resig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Do you have a simple example of this occurring? This will help us to
track down the problem. If this is an issue that was introduced in IE
7, then I'm not entirely sure what could be done to rectify it.

--John

On 10/23/07, weepy <jonahfox@...> wrote:

>
> Hi
>
> Im trying out the new document ready code from SVN.
>
> I am finding that when my page is within an iframe, document ready
> fires at the wrong point in IE7.
>
> IE6 and firefox work fine. IE7 worked ok with the old document ready
> code (e.g. 1.2)
>
> Any ideas how to fix this
>
> Sorry for the lack of punctuation im writing this on a danish
> keyboard !!
>
> jonah
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: document.ready firing too early within iframe

by Gabriel Harrison-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Without knowing any more than what is in the email and being a third  
party, I'd say that given two documents we're checking ready on the  
wrong one.

Sent from my iPhone

On Oct 22, 2007, at 9:26 PM, "John Resig" <jeresig@...> wrote:

>
> Do you have a simple example of this occurring? This will help us to
> track down the problem. If this is an issue that was introduced in IE
> 7, then I'm not entirely sure what could be done to rectify it.
>
> --John
>
> On 10/23/07, weepy <jonahfox@...> wrote:
>>
>> Hi
>>
>> Im trying out the new document ready code from SVN.
>>
>> I am finding that when my page is within an iframe, document ready
>> fires at the wrong point in IE7.
>>
>> IE6 and firefox work fine. IE7 worked ok with the old document ready
>> code (e.g. 1.2)
>>
>> Any ideas how to fix this
>>
>> Sorry for the lack of punctuation im writing this on a danish
>> keyboard !!
>>
>> jonah
>>
>>
>>>
>>
>
> >

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: document.ready firing too early within iframe

by weepy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


OK I've put up a proof of concept :

www.parkerfox.co.uk/tmp/test/test.html
  uses the svn jquery.js

www.parkerfox.co.uk/tmp/test/test2.html
  uses the 1.2.1 jquery.js

www.parkerfox.co.uk/tmp/test/embed.html
  embeds test.html in an iframe

www.parkerfox.co.uk/tmp/test/embed2.html
  embeds test2.html in an iframe

We expect to see the alert in the order 1,3,2 however in IE7 on
embed.html we get 1,2,3





On Oct 23, 12:26 am, "John Resig" <jere...@...> wrote:

> Do you have a simple example of this occurring? This will help us to
> track down the problem. If this is an issue that was introduced in IE
> 7, then I'm not entirely sure what could be done to rectify it.
>
> --John
>
> On 10/23/07, weepy <jonah...@...> wrote:
>
>
>
> > Hi
>
> > Im trying out the new document ready code from SVN.
>
> > I am finding that when my page is within an iframe, document ready
> > fires at the wrong point in IE7.
>
> > IE6 and firefox work fine. IE7 worked ok with the old document ready
> > code (e.g. 1.2)
>
> > Any ideas how to fix this
>
> > Sorry for the lack of punctuation im writing this on a danish
> > keyboard !!
>
> > jonah


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: document.ready firing too early within iframe

by John Resig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Fantastic test case - thanks a bunch! I'm going to start digging.

--John

On 10/23/07, weepy <jonahfox@...> wrote:

>
> OK I've put up a proof of concept :
>
> www.parkerfox.co.uk/tmp/test/test.html
>   uses the svn jquery.js
>
> www.parkerfox.co.uk/tmp/test/test2.html
>   uses the 1.2.1 jquery.js
>
> www.parkerfox.co.uk/tmp/test/embed.html
>   embeds test.html in an iframe
>
> www.parkerfox.co.uk/tmp/test/embed2.html
>   embeds test2.html in an iframe
>
> We expect to see the alert in the order 1,3,2 however in IE7 on
> embed.html we get 1,2,3
>
>
>
>
>
> On Oct 23, 12:26 am, "John Resig" <jere...@...> wrote:
> > Do you have a simple example of this occurring? This will help us to
> > track down the problem. If this is an issue that was introduced in IE
> > 7, then I'm not entirely sure what could be done to rectify it.
> >
> > --John
> >
> > On 10/23/07, weepy <jonah...@...> wrote:
> >
> >
> >
> > > Hi
> >
> > > Im trying out the new document ready code from SVN.
> >
> > > I am finding that when my page is within an iframe, document ready
> > > fires at the wrong point in IE7.
> >
> > > IE6 and firefox work fine. IE7 worked ok with the old document ready
> > > code (e.g. 1.2)
> >
> > > Any ideas how to fix this
> >
> > > Sorry for the lack of punctuation im writing this on a danish
> > > keyboard !!
> >
> > > jonah
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: document.ready firing too early within iframe

by weepy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks John

I look forward to any hidden treasure you find : )



On Oct 23, 9:06 am, "John Resig" <jere...@...> wrote:

> Fantastic test case - thanks a bunch! I'm going to start digging.
>
> --John
>
> On 10/23/07, weepy <jonah...@...> wrote:
>
>
>
> > OK I've put up a proof of concept :
>
> >www.parkerfox.co.uk/tmp/test/test.html
> >   uses the svn jquery.js
>
> >www.parkerfox.co.uk/tmp/test/test2.html
> >   uses the 1.2.1 jquery.js
>
> >www.parkerfox.co.uk/tmp/test/embed.html
> >   embeds test.html in an iframe
>
> >www.parkerfox.co.uk/tmp/test/embed2.html
> >   embeds test2.html in an iframe
>
> > We expect to see the alert in the order 1,3,2 however in IE7 on
> > embed.html we get 1,2,3
>
> > On Oct 23, 12:26 am, "John Resig" <jere...@...> wrote:
> > > Do you have a simple example of this occurring? This will help us to
> > > track down the problem. If this is an issue that was introduced in IE
> > > 7, then I'm not entirely sure what could be done to rectify it.
>
> > > --John
>
> > > On 10/23/07, weepy <jonah...@...> wrote:
>
> > > > Hi
>
> > > > Im trying out the new document ready code from SVN.
>
> > > > I am finding that when my page is within an iframe, document ready
> > > > fires at the wrong point in IE7.
>
> > > > IE6 and firefox work fine. IE7 worked ok with the old document ready
> > > > code (e.g. 1.2)
>
> > > > Any ideas how to fix this
>
> > > > Sorry for the lack of punctuation im writing this on a danish
> > > > keyboard !!
>
> > > > jonah


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: document.ready firing too early within iframe

by David Serduke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I got 1,2,3 in IE6 as well for embed.html (same as IE7).  Just another
tidbit.

This is running the standalone IE6 version on my IE7 machine in case
that matters.

David

On Oct 23, 9:06 am, weepy <jonah...@...> wrote:

> Thanks John
>
> I look forward to any hidden treasure you find : )
>
> On Oct 23, 9:06 am, "John Resig" <jere...@...> wrote:
>
>
>
> > Fantastic test case - thanks a bunch! I'm going to start digging.
>
> > --John
>
> > On 10/23/07, weepy <jonah...@...> wrote:
>
> > > OK I've put up a proof of concept :
>
> > >www.parkerfox.co.uk/tmp/test/test.html
> > >   uses the svn jquery.js
>
> > >www.parkerfox.co.uk/tmp/test/test2.html
> > >   uses the 1.2.1 jquery.js
>
> > >www.parkerfox.co.uk/tmp/test/embed.html
> > >   embeds test.html in an iframe
>
> > >www.parkerfox.co.uk/tmp/test/embed2.html
> > >   embeds test2.html in an iframe
>
> > > We expect to see the alert in the order 1,3,2 however in IE7 on
> > > embed.html we get 1,2,3
>
> > > On Oct 23, 12:26 am, "John Resig" <jere...@...> wrote:
> > > > Do you have a simple example of this occurring? This will help us to
> > > > track down the problem. If this is an issue that was introduced in IE
> > > > 7, then I'm not entirely sure what could be done to rectify it.
>
> > > > --John
>
> > > > On 10/23/07, weepy <jonah...@...> wrote:
>
> > > > > Hi
>
> > > > > Im trying out the new document ready code from SVN.
>
> > > > > I am finding that when my page is within an iframe, document ready
> > > > > fires at the wrong point in IE7.
>
> > > > > IE6 and firefox work fine. IE7 worked ok with the old document ready
> > > > > code (e.g. 1.2)
>
> > > > > Any ideas how to fix this
>
> > > > > Sorry for the lack of punctuation im writing this on a danish
> > > > > keyboard !!
>
> > > > > jonah- Hide quoted text -
>
> - Show quoted text -


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: document.ready firing too early within iframe

by weepy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


actaully so do I

On Oct 23, 1:08 pm, David Serduke <davidserd...@...> wrote:

> I got 1,2,3 in IE6 as well for embed.html (same as IE7).  Just another
> tidbit.
>
> This is running the standalone IE6 version on my IE7 machine in case
> that matters.
>
> David
>
> On Oct 23, 9:06 am, weepy <jonah...@...> wrote:
>
> > Thanks John
>
> > I look forward to any hidden treasure you find : )
>
> > On Oct 23, 9:06 am, "John Resig" <jere...@...> wrote:
>
> > > Fantastic test case - thanks a bunch! I'm going to start digging.
>
> > > --John
>
> > > On 10/23/07, weepy <jonah...@...> wrote:
>
> > > > OK I've put up a proof of concept :
>
> > > >www.parkerfox.co.uk/tmp/test/test.html
> > > >   uses the svn jquery.js
>
> > > >www.parkerfox.co.uk/tmp/test/test2.html
> > > >   uses the 1.2.1 jquery.js
>
> > > >www.parkerfox.co.uk/tmp/test/embed.html
> > > >   embeds test.html in an iframe
>
> > > >www.parkerfox.co.uk/tmp/test/embed2.html
> > > >   embeds test2.html in an iframe
>
> > > > We expect to see the alert in the order 1,3,2 however in IE7 on
> > > > embed.html we get 1,2,3
>
> > > > On Oct 23, 12:26 am, "John Resig" <jere...@...> wrote:
> > > > > Do you have a simple example of this occurring? This will help us to
> > > > > track down the problem. If this is an issue that was introduced in IE
> > > > > 7, then I'm not entirely sure what could be done to rectify it.
>
> > > > > --John
>
> > > > > On 10/23/07, weepy <jonah...@...> wrote:
>
> > > > > > Hi
>
> > > > > > Im trying out the new document ready code from SVN.
>
> > > > > > I am finding that when my page is within an iframe, document ready
> > > > > > fires at the wrong point in IE7.
>
> > > > > > IE6 and firefox work fine. IE7 worked ok with the old document ready
> > > > > > code (e.g. 1.2)
>
> > > > > > Any ideas how to fix this
>
> > > > > > Sorry for the lack of punctuation im writing this on a danish
> > > > > > keyboard !!
>
> > > > > > jonah- Hide quoted text -
>
> > - Show quoted text -


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: document.ready firing too early within iframe

by David Serduke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I'm just not getting any sort of error when I run doScroll() in an
iframe.  Even this failed when run in an iframe:

<script>
  document.documentElement.doScroll("left");
  for (var i = 0; i < 100; i++) {
    document.write("<div>Hi there</div>");
  }
</script>

and clearly the dom can't be ready in this case.  An error is thrown
when that is run directly in the browser.

David



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: document.ready firing too early within iframe

by weepy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


>> doScroll()

I was under the impression that the new IE version didn't use
doScroll(), rather some rather complex script/defer/ondomreadystate
method.

Or am I wrong ?





On Oct 23, 2:56 pm, David Serduke <davidserd...@...> wrote:

> I'm just not getting any sort of error when I run doScroll() in an
> iframe.  Even this failed when run in an iframe:
>
> <script>
>   document.documentElement.doScroll("left");
>   for (var i = 0; i < 100; i++) {
>     document.write("<div>Hi there</div>");
>   }
> </script>
>
> and clearly the dom can't be ready in this case.  An error is thrown
> when that is run directly in the browser.
>
> David


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: document.ready firing too early within iframe

by Diego Perini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Please try the following, change this line in jquery-svn:

   document.documentElement.doScroll('left');

to:

   document.body.doScroll('left');

and redo these tests, reporting success or failure.

Diego


On Oct 23, 7:29 pm, weepy <jonah...@...> wrote:

> actaully so do I
>
> On Oct 23, 1:08 pm, David Serduke <davidserd...@...> wrote:
>
> > I got 1,2,3 in IE6 as well for embed.html (same as IE7).  Just another
> > tidbit.
>
> > This is running the standalone IE6 version on my IE7 machine in case
> > that matters.
>
> > David
>
> > On Oct 23, 9:06 am, weepy <jonah...@...> wrote:
>
> > > Thanks John
>
> > > I look forward to any hidden treasure you find : )
>
> > > On Oct 23, 9:06 am, "John Resig" <jere...@...> wrote:
>
> > > > Fantastic test case - thanks a bunch! I'm going to start digging.
>
> > > > --John
>
> > > > On 10/23/07, weepy <jonah...@...> wrote:
>
> > > > > OK I've put up a proof of concept :
>
> > > > >www.parkerfox.co.uk/tmp/test/test.html
> > > > >   uses the svn jquery.js
>
> > > > >www.parkerfox.co.uk/tmp/test/test2.html
> > > > >   uses the 1.2.1 jquery.js
>
> > > > >www.parkerfox.co.uk/tmp/test/embed.html
> > > > >   embeds test.html in an iframe
>
> > > > >www.parkerfox.co.uk/tmp/test/embed2.html
> > > > >   embeds test2.html in an iframe
>
> > > > > We expect to see the alert in the order 1,3,2 however in IE7 on
> > > > > embed.html we get 1,2,3
>
> > > > > On Oct 23, 12:26 am, "John Resig" <jere...@...> wrote:
> > > > > > Do you have a simple example of this occurring? This will help us to
> > > > > > track down the problem. If this is an issue that was introduced in IE
> > > > > > 7, then I'm not entirely sure what could be done to rectify it.
>
> > > > > > --John
>
> > > > > > On 10/23/07, weepy <jonah...@...> wrote:
>
> > > > > > > Hi
>
> > > > > > > Im trying out the new document ready code from SVN.
>
> > > > > > > I am finding that when my page is within an iframe, document ready
> > > > > > > fires at the wrong point in IE7.
>
> > > > > > > IE6 and firefox work fine. IE7 worked ok with the old document ready
> > > > > > > code (e.g. 1.2)
>
> > > > > > > Any ideas how to fix this
>
> > > > > > > Sorry for the lack of punctuation im writing this on a danish
> > > > > > > keyboard !!
>
> > > > > > > jonah- Hide quoted text -
>
> > > - Show quoted text -


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: document.ready firing too early within iframe

by weepy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


www.parkerfox.co.uk/tmp/test/test3.html
  uses the svn jquery.js with Diego's alteration

www.parkerfox.co.uk/tmp/test/embed3.html
  embeds test3.html in an iframe

Both work as expected in both IE7 and IE6 !

Was there any reason for using 'documentElement'  ?




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: document.ready firing too early within iframe

by David Serduke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hmm, it seems to work now but for a different reason.  Before the
error.message with document.documentElement.doScroll was

"The data necessary to complete this operation is not yet available."

once the body change is in the error.message is

'document.body' is null or not an object

In fact, with document.body the doScroll doesn't matter at all.  You
can replace the line with

document.body.title;

to get the same effect.  Maybe that's fine, I don't know.  But some
more investigation should probably be done to see when it actually
fires when graphics are loading and such.  Unfortunately I have to go
in to a meeting now so can't do it.  I'll try later if I get the
chance and if someone else hasn't done so yet.

David

On Oct 23, 12:25 pm, weepy <jonah...@...> wrote:
> www.parkerfox.co.uk/tmp/test/test3.html
>   uses the svn jquery.js with Diego's alteration
>
> www.parkerfox.co.uk/tmp/test/embed3.html
>   embeds test3.html in an iframe
>
> Both work as expected in both IE7 and IE6 !
>
> Was there any reason for using 'documentElement'  ?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: document.ready firing too early within iframe

by weepy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I'd help - but I'm not quite sure what the problem is ...


On Oct 23, 1:30 pm, David Serduke <davidserd...@...> wrote:

> Hmm, it seems to work now but for a different reason.  Before the
> error.message with document.documentElement.doScroll was
>
> "The data necessary to complete this operation is not yet available."
>
> once the body change is in the error.message is
>
> 'document.body' is null or not an object
>
> In fact, with document.body the doScroll doesn't matter at all.  You
> can replace the line with
>
> document.body.title;
>
> to get the same effect.  Maybe that's fine, I don't know.  But some
> more investigation should probably be done to see when it actually
> fires when graphics are loading and such.  Unfortunately I have to go
> in to a meeting now so can't do it.  I'll try later if I get the
> chance and if someone else hasn't done so yet.
>
> David
>
> On Oct 23, 12:25 pm, weepy <jonah...@...> wrote:
>
>
>
> >www.parkerfox.co.uk/tmp/test/test3.html
> >   uses the svn jquery.js with Diego's alteration
>
> >www.parkerfox.co.uk/tmp/test/embed3.html
> >   embeds test3.html in an iframe
>
> > Both work as expected in both IE7 and IE6 !
>
> > Was there any reason for using 'documentElement'  ?- Hide quoted text -
>
> - Show quoted text -


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: document.ready firing too early within iframe

by Diego Perini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


@weepy,
yes there where several reasons to use "documentElement" the most
obvious being that it is the only element that we can trust on always
being present in a page from the beginning, when scripts executes.

That's also true if pages where written in a non standard way, I mean
missing the "HTML", "HEAD" or "BODY" elements, even all of them.

In fact, in these situations, IE automatically adds the missing
elements,
so in the test cases above if you print out the content of the page
with:

   alert(document.documentElement.outerHTML);

you will see that those elements are inserted automatically by IE
if missing initially. Also other browsers implements the same trick.

I am not sure that the tip using "body" instead of "documentElement"
will give expected results when there are images in the iframe,
or when "Transfer-Encoding: chunked" in dynamic pages.
For this I need to do some more testing....

I personally use a different approach to detect IFRAMEs have loaded.
I use different methods for different browsers. The only thing in
common
between these methods is that I listen for events on the "iframe"
parent.
So I use "DOMFrameContentLoaded" for Moz/FF, "onload" for Opera,
and "onreadystatechange" for IE.

I know that it would be great if we could use the same trick, but
apparently the main "window" is not completely comparable
in behavior with a "window" contained in an "iframe".

Diego


On Oct 23, 10:30 pm, David Serduke <davidserd...@...> wrote:

> Hmm, it seems to work now but for a different reason.  Before the
> error.message with document.documentElement.doScroll was
>
> "The data necessary to complete this operation is not yet available."
>
> once the body change is in the error.message is
>
> 'document.body' is null or not an object
>
> In fact, with document.body the doScroll doesn't matter at all.  You
> can replace the line with
>
> document.body.title;
>
> to get the same effect.  Maybe that's fine, I don't know.  But some
> more investigation should probably be done to see when it actually
> fires when graphics are loading and such.  Unfortunately I have to go
> in to a meeting now so can't do it.  I'll try later if I get the
> chance and if someone else hasn't done so yet.
>
> David
>
> On Oct 23, 12:25 pm, weepy <jonah...@...> wrote:
>
> >www.parkerfox.co.uk/tmp/test/test3.html
> >   uses the svn jquery.js with Diego's alteration
>
> >www.parkerfox.co.uk/tmp/test/embed3.html
> >   embeds test3.html in an iframe
>
> > Both work as expected in both IE7 and IE6 !
>
> > Was there any reason for using 'documentElement'  ?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: document.ready firing too early within iframe

by Diego Perini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


@David,
all your comments about this are correct.

The original scope of the "doScroll" seems defeated inside "iframes".
I can't get the same error in an "iframe" as in a normal "window".

Using "body" may seems to work but I am nearly sure it does not...
I believe it just worked in the tests above because tests are
so short and because there are no images in them.

Diego


On Oct 23, 10:30 pm, David Serduke <davidserd...@...> wrote:

> Hmm, it seems to work now but for a different reason.  Before the
> error.message with document.documentElement.doScroll was
>
> "The data necessary to complete this operation is not yet available."
>
> once the body change is in the error.message is
>
> 'document.body' is null or not an object
>
> In fact, with document.body the doScroll doesn't matter at all.  You
> can replace the line with
>
> document.body.title;
>
> to get the same effect.  Maybe that's fine, I don't know.  But some
> more investigation should probably be done to see when it actually
> fires when graphics are loading and such.  Unfortunately I have to go
> in to a meeting now so can't do it.  I'll try later if I get the
> chance and if someone else hasn't done so yet.
>
> David
>
> On Oct 23, 12:25 pm, weepy <jonah...@...> wrote:
>
> >www.parkerfox.co.uk/tmp/test/test3.html
> >   uses the svn jquery.js with Diego's alteration
>
> >www.parkerfox.co.uk/tmp/test/embed3.html
> >   embeds test3.html in an iframe
>
> > Both work as expected in both IE7 and IE6 !
>
> > Was there any reason for using 'documentElement'  ?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: document.ready firing too early within iframe

by weepy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> I believe it just worked in the tests above because tests are so short and because there are no images in them.

Yes you are right.

I uploaded :

http://www.parkerfox.co.uk/tmp/test/test4.html
http://www.parkerfox.co.uk/tmp/test/embed4.html

test4 is the same as test3 except for the fact that it loads a biig
image from nasa.
Also I added a window.onload alert.

So the order we expect is : 1324

In IE6 (no IE7 here to try) it works on the test page, but the embed
gives : 1234




On Oct 23, 6:15 pm, Diego Perini <diego.per...@...> wrote:

> @David,
> all your comments about this are correct.
>
> The original scope of the "doScroll" seems defeated inside "iframes".
> I can't get the same error in an "iframe" as in a normal "window".
>
> Using "body" may seems to work but I am nearly sure it does not...
> I believe it just worked in the tests above because tests are
> so short and because there are no images in them.
>
> Diego
>
> On Oct 23, 10:30 pm, David Serduke <davidserd...@...> wrote:
>
> > Hmm, it seems to work now but for a different reason.  Before the
> > error.message with document.documentElement.doScroll was
>
> > "The data necessary to complete this operation is not yet available."
>
> > once the body change is in the error.message is
>
> > 'document.body' is null or not an object
>
> > In fact, with document.body the doScroll doesn't matter at all.  You
> > can replace the line with
>
> > document.body.title;
>
> > to get the same effect.  Maybe that's fine, I don't know.  But some
> > more investigation should probably be done to see when it actually
> > fires when graphics are loading and such.  Unfortunately I have to go
> > in to a meeting now so can't do it.  I'll try later if I get the
> > chance and if someone else hasn't done so yet.
>
> > David
>
> > On Oct 23, 12:25 pm, weepy <jonah...@...> wrote:
>
> > >www.parkerfox.co.uk/tmp/test/test3.html
> > >   uses the svn jquery.js with Diego's alteration
>
> > >www.parkerfox.co.uk/tmp/test/embed3.html
> > >   embeds test3.html in an iframe
>
> > > Both work as expected in both IE7 and IE6 !
>
> > > Was there any reason for using 'documentElement'  ?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: document.ready firing too early within iframe

by weepy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


>I know that it would be great if we could use the same trick, but apparently the main "window" is not completely comparable in behavior with a "window"  contained in an "iframe".

yes i completely see what u mean. The old IE method seemed to work ok
tho - what was the reason to move away from it ?  perhaps in an iframe
we could fall back to that ?!

it's a shame not to have this as it means bye bye facebook for
jquery !



On Oct 23, 6:15 pm, Diego Perini <diego.per...@...> wrote:

> @David,
> all your comments about this are correct.
>
> The original scope of the "doScroll" seems defeated inside "iframes".
> I can't get the same error in an "iframe" as in a normal "window".
>
> Using "body" may seems to work but I am nearly sure it does not...
> I believe it just worked in the tests above because tests are
> so short and because there are no images in them.
>
> Diego
>
> On Oct 23, 10:30 pm, David Serduke <davidserd...@...> wrote:
>
> > Hmm, it seems to work now but for a different reason.  Before the
> > error.message with document.documentElement.doScroll was
>
> > "The data necessary to complete this operation is not yet available."
>
> > once the body change is in the error.message is
>
> > 'document.body' is null or not an object
>
> > In fact, with document.body the doScroll doesn't matter at all.  You
> > can replace the line with
>
> > document.body.title;
>
> > to get the same effect.  Maybe that's fine, I don't know.  But some
> > more investigation should probably be done to see when it actually
> > fires when graphics are loading and such.  Unfortunately I have to go
> > in to a meeting now so can't do it.  I'll try later if I get the
> > chance and if someone else hasn't done so yet.
>
> > David
>
> > On Oct 23, 12:25 pm, weepy <jonah...@...> wrote:
>
> > >www.parkerfox.co.uk/tmp/test/test3.html
> > >   uses the svn jquery.js with Diego's alteration
>
> > >www.parkerfox.co.uk/tmp/test/embed3.html
> > >   embeds test3.html in an iframe
>
> > > Both work as expected in both IE7 and IE6 !
>
> > > Was there any reason for using 'documentElement'  ?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: document.ready firing too early within iframe

by Diego Perini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


@weepy,
in your last test4 the script and jquery itself are in the body...put
them in the head
section or the tests will drive us away...and defeat all your good
debugging... :)

I have kept this back, for cases like this...hope it solves for you
(and iframes in general).
I tested it working. Sorry for the compression but have no time to
pretty-print it.

var IECheck;
function IEContentLoaded(w,f){
    // document has loaded (IE method 2) using behavior
    var load=false,d=w.document,s=d.createStyleSheet().owningElement;
    s.styleSheet.cssText='body{behavior:expression(IECheck(this));}';
    var fire=function(e){if(!load)
{load=true;f.call(d,e);setTimeout(function()
{s.parentNode.removeChild(s);},10);}};
    IECheck=function(n)
{try{d.documentElement.doScroll('left');n.runtimeStyle.behavior='none';}catch(e)
{return;}fire(null);};
}

Call this by passing window and function references.
I will let John implement a patch for current SVN
if he find it adequate, my knowledge ends here.

I just cut it out from my works on events see here (nearly at bottom
of file):

   http://javascript.nwbox.com/NWEvents/examples/nwevents-20070916.js

It is a mix of the "doScroll" trick driven by an IE CSS Expression.
This is more complex but also more powerful, more precise
and less intrusive than the previous setTimout trick and
work also with "iframes". Just hope so at the moment...

Diego


On Oct 24, 1:01 am, weepy <jonah...@...> wrote:

> >I know that it would be great if we could use the same trick, but apparently the main "window" is not completely comparable in behavior with a "window"  contained in an "iframe".
>
> yes i completely see what u mean. The old IE method seemed to work ok
> tho - what was the reason to move away from it ?  perhaps in an iframe
> we could fall back to that ?!
>
> it's a shame not to have this as it means bye bye facebook for
> jquery !
>
> On Oct 23, 6:15 pm, Diego Perini <diego.per...@...> wrote:
>
> > @David,
> > all your comments about this are correct.
>
> > The original scope of the "doScroll" seems defeated inside "iframes".
> > I can't get the same error in an "iframe" as in a normal "window".
>
> > Using "body" may seems to work but I am nearly sure it does not...
> > I believe it just worked in the tests above because tests are
> > so short and because there are no images in them.
>
> > Diego
>
> > On Oct 23, 10:30 pm, David Serduke <davidserd...@...> wrote:
>
> > > Hmm, it seems to work now but for a different reason.  Before the
> > > error.message with document.documentElement.doScroll was
>
> > > "The data necessary to complete this operation is not yet available."
>
> > > once the body change is in the error.message is
>
> > > 'document.body' is null or not an object
>
> > > In fact, with document.body the doScroll doesn't matter at all.  You
> > > can replace the line with
>
> > > document.body.title;
>
> > > to get the same effect.  Maybe that's fine, I don't know.  But some
> > > more investigation should probably be done to see when it actually
> > > fires when graphics are loading and such.  Unfortunately I have to go
> > > in to a meeting now so can't do it.  I'll try later if I get the
> > > chance and if someone else hasn't done so yet.
>
> > > David
>
> > > On Oct 23, 12:25 pm, weepy <jonah...@...> wrote:
>
> > > >www.parkerfox.co.uk/tmp/test/test3.html
> > > >   uses the svn jquery.js with Diego's alteration
>
> > > >www.parkerfox.co.uk/tmp/test/embed3.html
> > > >   embeds test3.html in an iframe
>
> > > > Both work as expected in both IE7 and IE6 !
>
> > > > Was there any reason for using 'documentElement'  ?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: document.ready firing too early within iframe

by weepy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


nicely done !

I've implemented in the 'test suite' :

http://www.parkerfox.co.uk/tmp/test/test5.html
http://www.parkerfox.co.uk/tmp/test/embed5.html

works as hoped for in FF, IE6 and IE7




On Oct 23, 8:19 pm, Diego Perini <diego.per...@...> wrote:

> @weepy,
> in your last test4 the script and jquery itself are in the body...put
> them in the head
> section or the tests will drive us away...and defeat all your good
> debugging... :)
>
> I have kept this back, for cases like this...hope it solves for you
> (and iframes in general).
> I tested it working. Sorry for the compression but have no time to
> pretty-print it.
>
> var IECheck;
> function IEContentLoaded(w,f){
>     // document has loaded (IE method 2) using behavior
>     var load=false,d=w.document,s=d.createStyleSheet().owningElement;
>     s.styleSheet.cssText='body{behavior:expression(IECheck(this));}';
>     var fire=function(e){if(!load)
> {load=true;f.call(d,e);setTimeout(function()
> {s.parentNode.removeChild(s);},10);}};
>     IECheck=function(n)
> {try{d.documentElement.doScroll('left');n.runtimeStyle.behavior='none';}catch(e)
> {return;}fire(null);};
>
> }
>
> Call this by passing window and function references.
> I will let John implement a patch for current SVN
> if he find it adequate, my knowledge ends here.
>
> I just cut it out from my works on events see here (nearly at bottom
> of file):
>
>    http://javascript.nwbox.com/NWEvents/examples/nwevents-20070916.js
>
> It is a mix of the "doScroll" trick driven by an IE CSS Expression.
> This is more complex but also more powerful, more precise
> and less intrusive than the previous setTimout trick and
> work also with "iframes". Just hope so at the moment...
>
> Diego
>
> On Oct 24, 1:01 am, weepy <jonah...@...> wrote:
>
> > >I know that it would be great if we could use the same trick, but apparently the main "window" is not completely comparable in behavior with a "window"  contained in an "iframe".
>
> > yes i completely see what u mean. The old IE method seemed to work ok
> > tho - what was the reason to move away from it ?  perhaps in an iframe
> > we could fall back to that ?!
>
> > it's a shame not to have this as it means bye bye facebook for
> > jquery !
>
> > On Oct 23, 6:15 pm, Diego Perini <diego.per...@...> wrote:
>
> > > @David,
> > > all your comments about this are correct.
>
> > > The original scope of the "doScroll" seems defeated inside "iframes".
> > > I can't get the same error in an "iframe" as in a normal "window".
>
> > > Using "body" may seems to work but I am nearly sure it does not...
> > > I believe it just worked in the tests above because tests are
> > > so short and because there are no images in them.
>
> > > Diego
>
> > > On Oct 23, 10:30 pm, David Serduke <davidserd...@...> wrote:
>
> > > > Hmm, it seems to work now but for a different reason.  Before the
> > > > error.message with document.documentElement.doScroll was
>
> > > > "The data necessary to complete this operation is not yet available."
>
> > > > once the body change is in the error.message is
>
> > > > 'document.body' is null or not an object
>
> > > > In fact, with document.body the doScroll doesn't matter at all.  You
> > > > can replace the line with
>
> > > > document.body.title;
>
> > > > to get the same effect.  Maybe that's fine, I don't know.  But some
> > > > more investigation should probably be done to see when it actually
> > > > fires when graphics are loading and such.  Unfortunately I have to go
> > > > in to a meeting now so can't do it.  I'll try later if I get the
> > > > chance and if someone else hasn't done so yet.
>
> > > > David
>
> > > > On Oct 23, 12:25 pm, weepy <jonah...@...> wrote:
>
> > > > >www.parkerfox.co.uk/tmp/test/test3.html
> > > > >   uses the svn jquery.js with Diego's alteration
>
> > > > >www.parkerfox.co.uk/tmp/test/embed3.html
> > > > >   embeds test3.html in an iframe
>
> > > > > Both work as expected in both IE7 and IE6 !
>
> > > > > Was there any reason for using 'documentElement'  ?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

< Prev | 1 - 2 | Next >