Webspeeder
asked on
I'm unable to capture height of page ...
Hey all.
I'm trying to capture the height of a page but cannot do it. The page is loaded with tabled data via an AJAX call so the height is "dynamic": it depends on the amount of data returned.
I've tried the following.
alert('body '+$('body').height()+'\n'+
'html '+$('html').height()+'\n'+
'doct '+$(document).height());
They all come back as 13, 13 and 50. The 50 I think comes from the height of the parent iframe being set to "contents.body.height + 50.
This alert is being show in the contents page.
For example
iframe is displayed in page A. Page B is loaded inside the iframe. When page B loads is when the alert box is shown, inside page B.
Any ideas?
The height of page B is not being specifically set.
I'm trying to capture the height of a page but cannot do it. The page is loaded with tabled data via an AJAX call so the height is "dynamic": it depends on the amount of data returned.
I've tried the following.
alert('body '+$('body').height()+'\n'+
'html '+$('html').height()+'\n'+
'doct '+$(document).height());
They all come back as 13, 13 and 50. The 50 I think comes from the height of the parent iframe being set to "contents.body.height + 50.
This alert is being show in the contents page.
For example
iframe is displayed in page A. Page B is loaded inside the iframe. When page B loads is when the alert box is shown, inside page B.
Any ideas?
The height of page B is not being specifically set.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That gave me an idea though. I do the check after the data i loaded and it changes to 576 for this one example. I think this may be what I need to do.
Yeah that makes sense. The dynamic data load does not start until after the page structure is loaded, so the table and the body do not get expanded until that load completes. The browsers generally buffer table loads because they do not know how much space they need for the cells until all the data has been loaded.
Cd&
Cd&
ASKER