SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2006
    Location
    Utrecht
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    printing cross-domain iframe

    Hi all, my first post

    I have a small website, with on the left side a list with links to external websites. These websites load in a iframe next to the list. Now i have a print button, it should only print out the website. My first try was with CSS, but it won't print the entire content of the iframe. It'll only print the part that's visible on the scream. I also tried #frame{height+width 100%} in the print.css, but it won't work with a long content.

    Next try was with javascript. But it will give cross-domain errors (acces denied) when trying the print the source.

    here are some other sources where pretty much the same question got asked. They don't provide a solution but maybe some more insight or offer a better explanation:
    http://www.tek-tips.com/v...fm?qid=1168400&page=6
    http://www.thescripts.com/forum/thread168496.html
    Last edited by lowen.f; Dec 14, 2006 at 09:08. Reason: extra sources

  2. #2
    SitePoint Enthusiast Setac's Avatar
    Join Date
    Nov 2000
    Location
    San Marcos CA
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cross Domain

    You can avoid the cross domain issues by using an XML page scrape server side and creat your own page with the content you want to print.

    Creating the page within your site and having it do a page scrape, loading that into the frame or whatever will eliiminate the problem. When it is printed it will be seen as a local page.
    Dynamic HTML - Is that a Frisbee based language...

  3. #3
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could have a button that opens the iframe in a new window, and the user can print from there. I dont think you're going to have much luck with the iframe though.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •