Click to See Complete Forum and Search --> : External HTML into no scroll IFRAME


cxb
04-15-2003, 01:33 PM
I am trying to load the content of an external html page into an iFrame. This is easy in itself however I do not want the iFrame to have a scroll bar, all scrolling should be controlled by the standard browser scroll.

I managed to find a solution on the net for this problem but it has created another: any javascript functionality on the child page is lost because the solution I have uses innerHTML and any javascript appears to be ignored.

Both pages will reside within the same domain however I wish to keep them as completely separate entities (only retaining the parent/child relationship). I do not wish to move the javascript from the child page into the parent which I believe would solve this problem.

I have attached 2 files which are an example of the problem I have (my actual code has irrelevant content for the purposes of this discussion).

I'm not sure if the innerHTML method can work, I've tried playing around with document.all but with no success (I'm not very experienced in JS).

Please let me know if what I am trying to do is possible, example code for a solution would be greatly appreciated.

Thank you.

FredLabrosse
04-15-2003, 01:39 PM
Originally posted by cxb
Please let me know if what I am trying to do is possible, example code for a solution would be greatly appreciated.

Thank you.

yes you are, biatch!

http://www.geocities.com/RainForest/4076/porcupine.jpg

sabretooth80
04-17-2003, 12:04 AM
Did you find an answer to your problem? I'm trying to do the exact opposite thing - copy the html (including javascript functions) from an iframe to a new window.
So far I have
var winn = window.open('', 'child');

winn.document.write('<' + window.top.document.iframeName.document.documentElement.tagName + '>\n');
winn.document.write(window.top.document.iframeName.document.documentElement.innerHTML);
winn.document.write('\n</' + window.top.document.iframeName.document.documentElement.tagName + '>');

The problem with this is that the javascript doesn't seem to work after it gets copied. I end up with lots of &amp;#13;&amp;#10;&amp;#9;&amp;#9;&amp;#9; in the html in the new window and maybe that is the problem. Any ideas on how to solve this or an alternative method?

cxb
04-17-2003, 03:17 AM
Sorry, I've not got any further with this. Fred obviously reckons it's impossible. Hopefully someone can prove otherwise and find a solution to this problem.

cxb
04-17-2003, 11:01 AM
I've decided to give up on the above method and use Framesets instead. It means a bit of redesign and the scrolling functionality isn't exactly what I was looking for, but it's close enough.

If anybody does find a solution I'd be grateful if they'd post it anyway as I (or others) may need it in the future.

Cheers.