By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,569 Members | 1,338 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,569 IT Pros & Developers. It's quick & easy.

Warning / Helping the Surfer Before They Print The HTML page

P: n/a
I'm a newbie to JavaScript so be gentle.

You know that funky IE margin issue that causes the right side of the
page to get cut off when the user prints the html document?
http://www.post-gazette.com/interact/20000120radin.asp
Well… I'd like to warn/help the IE users of the issue before they
print page.
I want to combine a popup message with
onClick="javascript:window.print

Here's what I have so far.
<script language="JavaScript">
<!--
<a href="#" onClick="MM_popupMsg('Before You print, I'd like you to
read about the IE margin problem')">

else if (window.print) {
document.write('<a href="#" onClick="javascript:window.print()">' +
'<img src="assets/frontpage_print_button.gif" width="146" height="29"
border="0">' + '</a>');
}
// -->

</script>

What do you think?
I'm guessing the "else if" is not the solution.

Thanks in advance for the help.

PS. The pages that I've built are 760px Ice and the function for the
popup message is..

function MM_popupMsg(msg) { //v1.0
alert(msg);
}

Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Fred wrote:
I'm a newbie to JavaScript so be gentle.

You know that funky IE margin issue that causes the right side of the
page to get cut off when the user prints the html document?
http://www.post-gazette.com/interact/20000120radin.asp
Never heard of it but I rarely print in IE.

Well… I'd like to warn/help the IE users of the issue before they
print page.
And how do you propose to determing they are using IE?
I want to combine a popup message with
onClick="javascript:window.print
Oh geez.
Here's what I have so far.
Throw it away.

<script language="JavaScript">
<!--
<a href="#" onClick="MM_popupMsg('Before You print, I'd like you to
read about the IE margin problem')">
Thats a syntax error, did you test it before posting?

else if (window.print) {
document.write('<a href="#" onClick="javascript:window.print()">' +
'<img src="assets/frontpage_print_button.gif" width="146" height="29"
border="0">' + '</a>');
Frontpage and DreamWeaver mixed? I guess it really *can* get worse than
FP or DW
}
// -->

</script>

What do you think?
I think its junk.
I'm guessing the "else if" is not the solution.
No, its not the solution. The solution, if its that important to you, is
to place a link on the page such as:

<a href="http://www.post-gazette.com/interact/20000120radin.asp">IE
Print Problem</a>
Thanks in advance for the help.
Umm, yeah, ok.
PS. The pages that I've built are 760px Ice and the function for the
popup message is..
What is "760px Ice"? I bet it would look nice in my preferred size
browser window of 600px wide. Or even better if I maximize it at 2048px
wide.

http://allmyfaqs.com/faq.pl?AnySizeDesign
function MM_popupMsg(msg) { //v1.0
alert(msg);
}


There's that DreamWeaver code I mentioned. Sheesh, its getting worse.

P.S. Anybody that passes an argument to a function to simply alert a
message needs to learn the language first :-x

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #2

P: n/a
My goal is post a print button on every page of the site that displays
a message before the document prints.

-They click the print button
-A message appears and they read it
-They click ok and they get the print prompt.

That's it, nothing more nothing less.

Belive me, I know the code I posted sucks.
I posted it with hopes that some one would post how the code should
really look.

I think it sucks to ask for help and not provide some code as an
example. Even if the code sucks.


On Thu, 17 Feb 2005 21:11:23 -0500, Randy Webb
<Hi************@aol.com> wrote:
Fred wrote:
I'm a newbie to JavaScript so be gentle.

You know that funky IE margin issue that causes the right side of the
page to get cut off when the user prints the html document?
http://www.post-gazette.com/interact/20000120radin.asp


Never heard of it but I rarely print in IE.

Well… I'd like to warn/help the IE users of the issue before they
print page.


And how do you propose to determing they are using IE?
I want to combine a popup message with
onClick="javascript:window.print


Oh geez.
Here's what I have so far.


Throw it away.

<script language="JavaScript">
<!--
<a href="#" onClick="MM_popupMsg('Before You print, I'd like you to
read about the IE margin problem')">


Thats a syntax error, did you test it before posting?

else if (window.print) {
document.write('<a href="#" onClick="javascript:window.print()">' +
'<img src="assets/frontpage_print_button.gif" width="146" height="29"
border="0">' + '</a>');


Frontpage and DreamWeaver mixed? I guess it really *can* get worse than
FP or DW
}
// -->

</script>

What do you think?


I think its junk.
I'm guessing the "else if" is not the solution.


No, its not the solution. The solution, if its that important to you, is
to place a link on the page such as:

<a href="http://www.post-gazette.com/interact/20000120radin.asp">IE
Print Problem</a>
Thanks in advance for the help.


Umm, yeah, ok.
PS. The pages that I've built are 760px Ice and the function for the
popup message is..


What is "760px Ice"? I bet it would look nice in my preferred size
browser window of 600px wide. Or even better if I maximize it at 2048px
wide.

http://allmyfaqs.com/faq.pl?AnySizeDesign
function MM_popupMsg(msg) { //v1.0
alert(msg);
}


There's that DreamWeaver code I mentioned. Sheesh, its getting worse.

P.S. Anybody that passes an argument to a function to simply alert a
message needs to learn the language first :-x


Jul 23 '05 #3

P: n/a

Fred wrote:
My goal is post a print button on every page of the site that displays a message before the document prints.

-They click the print button
-A message appears and they read it
-They click ok and they get the print prompt.


Some sites like yahoo maps have a printer friendly version of the page.
Why don't you look at yahoo maps. Instead of refering them to a web
page that doesn't provide a lot of help, I suggest creating a printer
friendly page.

Robert

Jul 23 '05 #4

P: n/a
I figured it out

Thanks
Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.