Jed,
try these changes in current 1.3.2.

Change line 4352 from:

   return this[0] == window ?

to:

   return 'frameElement' in this[0] ?

and line 4358 from:

   this[0] == document ?

to:

   'documentElement' in this[0] ?

this will probably fix your problem (the one in the posted code), also
I don't know if that would be the best fix, nor if the resulting pixel
values are OK, I just assume so. I only changed the testing which was
implying the document/window are the same as those where jQuery lives
(where it was loaded).

I don't like those tests assuming only one document/window exists (the
one where jQuery is) but I haven't go through all the code, I seem to
remember there were several place taking these assumptions in the
code. I have been a high supporter of these changes in jQuery for a
long time but they are not in yet (not completely as you could find
out yourself).

The fact you are loading jQuery in a sub-frame makes up the special
edge case, and jQuery is not ready to handle some of these cross-frame
situations. Hope this helps.

Diego


On 8 Mag, 06:34, Jed Schmidt <[email protected]> wrote:
> Hello all.
>
> I have two html documents.
>
> (1) parent.html
>
> <html>
>   <body>
>     <iframe src="child.html"/>
>   </body>
> </html>
>
> (2) child.html
>
> <html>
>   <head>
>     <script type="text/javascript" src="http://ajax.googleapis.com/
> ajax/libs/jquery/1.3.2/jquery.min.js"></script>
>     <script type="text/javascript">
>       alert( $( window.parent.document ) );
>         // CORRECT: alerts "[object Object]"
>
>       alert( $( window.parent.document.body ).height() );
>         // CORRECT: alerts "154"
>
>       alert( $( window.parent.document ).height() );
>         // ERROR: "Could not convert JavaScript argument arg 0"
>
>       alert( $( window.parent ).height() );
>         // ERROR: "Could not convert JavaScript argument arg 0"
>     </script>
>   </head>
> </html>
>
> As is visible from the code, I'm having trouble getting the height of
> the document in the parent window. I can access the window, document,
> and body of the parent without issue, but can only access the height
> of the parent's body. An error is thrown when I try to access the
> height of the parent window or document.
>
> Is there something I'm missing here, or does this need a ticket?
>
> Jed Schmidt
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to