/    Sign up×
Community /Pin to ProfileBookmark

IFrame printing troubles

I never had problems printing iFrames, but … Can anybody help?

[code]
<HTML>
<HEAD>
<SCRIPT LANGUAGE=javascript>
<!–
function printFrame(id)
{
var iFrm=document.getElementById(id);
if (iFrm) { iFrm.focus(); // here everything is fine
iFrm.print(); } // ERROR: objects doesn’t support this property or method
}
//–>
</SCRIPT></HEAD>
<BODY>
<SPAN onclick=”printFrame(‘frame1’)”>Print</SPAN>
<IFRAME name=”frame1″ id=”frame1″ src=”test.htm”></IFRAME>

</BODY>
</HTML>

[/code]

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@runlevel007authorNov 20.2003 — Anybody??
Copy linkTweet thisAlerts:
@TheBearMayNov 20.2003 — Haven't had to time to figure out why, but if I replace your
[code=php]
if (iFrm) { iFrm.focus();
iFrm.print(); }
[/code]

with
[code=php]eval(id).focus();
eval(id).print();[/code]

it works for me...
Copy linkTweet thisAlerts:
@runlevel007authorNov 20.2003 — It worked! I have no idea, why, but as long as it is working.

Thanks TheBearMay!?
×

Success!

Help @runlevel007 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...