[jQuery] Re: what would be the opposite of top.frames as a jquery selector context?

2009-01-30 Thread jquertil

it ended up being quite easy actually:

$('#'+self.name, top.document).hide();

usually whenever I try to so something and it requires more than 1
line of code it's my fault, not jquery's...


[jQuery] Re: what would be the opposite of top.frames as a jquery selector context?

2009-01-27 Thread maggus.st...@googlemail.com

maybe the parent of your documentElement?

On 27 Jan., 21:36, jquertil til...@gmail.com wrote:
 If i want to do something in a parent frame, I would do this:

 $('#myDiv', top.document).hide();

 but what about this following scenario? I'm inside a frame that was
 created like so:

 $('body', top.document).append('iframe id=myiframe/iframe');

 inside myiframe, I now want to know the id of my iframe, because I
 would not know it.

 All I am able to see in the DOM is the topmost document.

 I could traverse through all the iframes and get their ID's but that's
 useless because I wouldn't know which of them is the one I'm currently
 in.

 I suppose I'm simply trying to pass a variable to a child frame so it
 becomes available on the frame's document.onload().


[jQuery] Re: what would be the opposite of top.frames as a jquery selector context?

2009-01-27 Thread jay

Look at the test case I made here and let me know if it helps:

http://jquery.nodnod.net/cases/73

On Jan 27, 3:36 pm, jquertil til...@gmail.com wrote:
 If i want to do something in a parent frame, I would do this:

 $('#myDiv', top.document).hide();

 but what about this following scenario? I'm inside a frame that was
 created like so:

 $('body', top.document).append('iframe id=myiframe/iframe');

 inside myiframe, I now want to know the id of my iframe, because I
 would not know it.

 All I am able to see in the DOM is the topmost document.

 I could traverse through all the iframes and get their ID's but that's
 useless because I wouldn't know which of them is the one I'm currently
 in.

 I suppose I'm simply trying to pass a variable to a child frame so it
 becomes available on the frame's document.onload().


[jQuery] Re: what would be the opposite of top.frames as a jquery selector context?

2009-01-27 Thread jay

the $(frames.frameName.document).ready is not actually working on
firefox.. you would probably have to put $(document).ready in the src
page and poll it to see if the document is actually ready

On Jan 27, 4:27 pm, jay jay.ab...@gmail.com wrote:
 Look at the test case I made here and let me know if it helps:

 http://jquery.nodnod.net/cases/73

 On Jan 27, 3:36 pm, jquertil til...@gmail.com wrote:



  If i want to do something in a parent frame, I would do this:

  $('#myDiv', top.document).hide();

  but what about this following scenario? I'm inside a frame that was
  created like so:

  $('body', top.document).append('iframe id=myiframe/iframe');

  inside myiframe, I now want to know the id of my iframe, because I
  would not know it.

  All I am able to see in the DOM is the topmost document.

  I could traverse through all the iframes and get their ID's but that's
  useless because I wouldn't know which of them is the one I'm currently
  in.

  I suppose I'm simply trying to pass a variable to a child frame so it
  becomes available on the frame's document.onload().- Hide quoted text -

 - Show quoted text -


[jQuery] Re: what would be the opposite of top.frames as a jquery selector context?

2009-01-27 Thread jay

This seemed to work on FF and IE:

$('#myiframe')[0].onload=function(){
   $(body,frames.frmName.document).html('test')
}

On Jan 27, 3:36 pm, jquertil til...@gmail.com wrote:
 If i want to do something in a parent frame, I would do this:

 $('#myDiv', top.document).hide();

 but what about this following scenario? I'm inside a frame that was
 created like so:

 $('body', top.document).append('iframe id=myiframe/iframe');

 inside myiframe, I now want to know the id of my iframe, because I
 would not know it.

 All I am able to see in the DOM is the topmost document.

 I could traverse through all the iframes and get their ID's but that's
 useless because I wouldn't know which of them is the one I'm currently
 in.

 I suppose I'm simply trying to pass a variable to a child frame so it
 becomes available on the frame's document.onload().