0

I have a webpage that I would like to embed within another page. On the page that is to be embedded I have some window.onload javascript that will load a PDF document via the embed tag. If I use just the Iframe tag like this:

<iframe name="content" id="iframe" allowtransparency="true" src="Pages/menu.html" scrolling="no"></iframe>

The Javascript will run just fine. But I am trying to create a background and border for the iframe so I have wrapped the iframe in a div like so:

<div id="content" class="border">
<iframe name="content" id="iframe" allowtransparency="true" src="Pages/menu.html"    scrolling="no"></iframe>
</div>

As soon as I do it this way the javascript will not run. Here is the screenshot of what I am trying to do. I do not believe that the styling that is present on the div ( curved borders, gradient, etc is possible on an iframe) I am using PDFObject to generate the PDF on the page. The iframe is also loading the company's external website in the content section on demand and this is what they want so unfortunately i have to use iframes. This has to be done without using anything except javascript as well otherwise I would just use php.

I have to post the SCREENSHOT outside of this site on photobucket due to restritions sorry: http://i721.photobucket.com/albums/ww217/the_t3rminat0r/Capture-2.png

5
  • 2
    The question is tagged as javascript, where is it?
    – Dr.Molle
    Sep 14, 2012 at 2:49
  • Does it still happen if you remove the id and class attributes of the wrapping div? I don't know why they'd affect this, but then again, I don't know why anything you've used could affect this...
    – Ian
    Sep 14, 2012 at 3:04
  • and removing the id and class does fix it time to redo those css. Narrowed it down to the border class which is to long to post please go to : link to see the offending css. Regarding the javascript, which javascript do you want to see? the entire showing of the PDF is done via javascript, the file is very long so please go to pdfobject.com to see examples. There is alot of javascript and I was figuring that javascript couldnt load in iframes within divs. Sep 14, 2012 at 3:10
  • 1
    OK because I had to use a workaround to have css3 with somewhat newer versions of IE I had to use PIE to be able to show the rounded borders. This is what was breaking the javascript. I moved the PIE.htc file to the directory of the MAIN page and it all started working. Thank you for helping me figure this one out. @ianpgall Sep 14, 2012 at 3:22
  • @user1670250 no problem, glad that could help you figure it out!
    – Ian
    Sep 14, 2012 at 3:26

1 Answer 1

0

It looks margin property in div style (or border class in your example) causes the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.