I am trying to get the width of the page in an iframe (on the same domain) using the following:
document.getElementById('iframe').clientWidth
but it seems not to be working. The iframe width is a constant but I want to get the page width based on whether there is a scrollbar or not. If there is not scrollbar, the code should give the fixed iframe width, if there is a scrollbar (which means the page content height is greater than iframe height), the code should give fixed iframe width minus 17 (scrollbar width).
Doesn’t that give the width of the iframe itself? I need the width of the page within the iframe. For example, the following code returns the window width and window width minus the scrollbar, I am trying to do the same for the iframe if possible.