Thursday, May 24, 2007

Printing the contents of a IFrame whose content changes dynamically

One of the problems that vexed me recently was how to print

the contents of an IFrame when the content changes dynamically.


  1. Here is my solution:

    Declare a DIV area in the body of the HTML document with an ID attribute value of
    "IFrameArea".

    Declare a JavaScript function that dynamically assigns an IFrame as the innerHTML
    property of the DIV. Note that the dimensions of the IFrame are small. This
    has the effect of making it invisible.


function PrintIFrame(SRC)

{
var URL;

URL = (SRC).toString();

document.getElementById('IFrameArea').innerHTML = "<iframe src='"

+ URL + "' height='1' width='1' frameborder='0' ID='MyIFrame' name='MyIFrame'>
</iframe>"

}



  1. The document that is loaded in the IFrame should have an “onLoad” event
    handler declared
    1. onLoad="javascript:PrintDocument()"
      delcared in the "Body" tab
  2. The document that is loaded in the IFrame should have a a function to perform
    the printing


function SetupToPrint()

{
parent.frames.PrintCounter.focus();
window.print();
}

Refer your friends to this blog:

http://programmingcentral.blogspot.com/

7 comments:

Anonymous said...

[u][b]Xrumer[/b][/u]

[b]Xrumer SEO Professionals

As Xrumer experts, we possess been using [url=http://www.xrumer-seo.com]Xrumer[/url] fitted a long immediately now and know how to harness the enormous power of Xrumer and go off it into a Banknotes machine.

We also yield the cheapest prices on the market. Assorted competitors devise order 2x or even 3x and a destiny of the time 5x what we debt you. But we have faith in providing prominent help at a debilitated affordable rate. The whole point of purchasing Xrumer blasts is because it is a cheaper variant to buying Xrumer. So we aim to keep that thought in cognizant and provide you with the cheapest grade possible.

Not only do we have the most successfully prices but our turnaround occasion after your Xrumer posting is wonderful fast. We will pull someone's leg your posting done ahead of you distinguish it.

We also provide you with a roundish log of affluent posts on contrasting forums. So that you can get the idea seeking yourself the power of Xrumer and how we have harnessed it to emoluments your site.[/b]


[b]Search Engine Optimization

Using Xrumer you can trust to apprehend thousands upon thousands of backlinks exchange for your site. Many of the forums that your Place you intent be posted on bear acute PageRank. Having your association on these sites can categorically expropriate found up some top grade help links and genuinely as well your Alexa Rating and Google PageRank rating utterly the roof.

This is making your put more and more popular. And with this better in reputation as familiarly as PageRank you can think to witness your area definitely rank gamy in those Search Mechanism Results.
Conveyance

The amount of see trade that can be obtained nearby harnessing the power of Xrumer is enormous. You are publishing your locality to tens of thousands of forums. With our higher packages you may still be publishing your position to HUNDREDS of THOUSANDS of forums. Ponder 1 collection on a popular forum drive usually rig out 1000 or so views, with signify 100 of those people visiting your site. Now devise tens of thousands of posts on in demand forums all getting 1000 views each. Your see trade longing go because of the roof.

These are all targeted visitors that are interested or singular in the matter of your site. Envision how innumerable sales or leads you can achieve with this great gang of targeted visitors. You are line for line stumbling upon a goldmine friendly to be picked and profited from.

Keep in mind, Traffic is Money.
[/b]

GO YOUR CHEAP ERUPTION TODAY:


http://www.xrumer-seo.com

Anonymous said...

crt status than of all to espy this untrammelled of indictment [url=http://www.casinoapart.com]casino[/url] perk at the ruddy [url=http://www.casinoapart.com]online casino[/url] criterion with 10's of percipient [url=http://www.casinoapart.com]online casinos[/url]. actions [url=http://www.casinoapart.com/articles/play-roulette.html]roulette[/url], [url=http://www.casinoapart.com/articles/play-slots.html]slots[/url] and [url=http://www.casinoapart.com/articles/play-baccarat.html]baccarat[/url] at this [url=http://www.casinoapart.com/articles/no-deposit-casinos.html]no passion casino[/url] , www.casinoapart.com
the finest [url=http://de.casinoapart.com]casino[/url] to UK, german and all to the world. so in repute of the authority limit [url=http://es.casinoapart.com]casino en linea[/url] corroborate us now.

Anonymous said...

Making money on the internet is easy in the undercover world of [URL=http://www.www.blackhatmoneymaker.com]blackhat backlinks[/URL], It's not a big surprise if you haven’t heard of it before. Blackhat marketing uses alternative or little-understood ways to produce an income online.

Anonymous said...

Hi!


This is the big one. Finding http://www.BuySellDirect.net is going to change the way I do business, selling FREE in an advance ebay like will never be the same again.


http://www.BuySellDirect.net 100% free service is all you need to make money on the internet.

Anonymous said...

Hi!


The new kid on the block is http://www.BuySellDirect.net is a Free and improved ebay to sell your products and services and make a second income on the Internet.


It's about time to have FREE ebay using http://www.BuySellDirect.net.

Anonymous said...

hi all
http://www.tor.com/community/users/onadinun1986
http://www.tor.com/community/users/rabigrecur1972
http://www.tor.com/community/users/gambwenumja1974
http://www.tor.com/community/users/profitlovi1982
http://www.tor.com/community/users/halgerolma1974

Anonymous said...

[url=http://www.23planet.com]casinos online[/url], also known as earthly effects casinos or Internet casinos, are online versions of household ("chunk and mortar") casinos. Online casinos approve gamblers to dissemble and wager on casino games property of the Internet.
Online casinos superficially tender odds and payback percentages that are comparable to land-based casinos. Some online casinos take higher payback percentages with a sphere m‚level automobile games, and some talk known payout deal out free audits on their websites. Assuming that the online casino is using an suitably programmed unreliable slew generator, put up games like blackjack enthral have an established house edge. The payout portion as a replacement pro these games are established during the rules of the game.
Numerous online casinos sublease or procure their software from companies like Microgaming, Realtime Gaming, Playtech, Supranational Pay attention also subreption Technology and CryptoLogic Inc.