views:

598

answers:

1

is there a way to detect if content of my iframe has change...

my work around is i have a loop which constantly check for the height of the content it effective but not efficient is there another way of doing this?

thanks,

+1  A: 

Since the contents of the iframe has a separate window element, you can do this in a script inside of the iframe.

$(window).resize(function(){
  var object = $(this)
  // Use `object.height()` and `object.width()`.
});

You could also use $("#the_iframe")[0].contentWindow.window (or something like that) instead of window to access the window object of the iframe from the scope that contains the iframe.

August Lilleaas
Thank You.. i'll try this..
yoshi