473,224 Members | 1,364 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

Warning / Helping the Surfer Before They Print The HTML page

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
4 3189
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
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

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
I figured it out

Thanks
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: None | last post by:
Hello, I am a total newbie to PHP and programming in general. I am playing around with a PHP / MySQL shopping cart script which I found at...
6
by: Zip Code | last post by:
"The large print giveth, and the small print taketh away.", so said Tom Waites in his classic rap, "Step Right Up", a paean about come ons and rip offs. Now, we have all explored the fact that...
109
by: Andrew Thompson | last post by:
It seems most people get there JS off web sites, which is entirely logical. But it is also a great pity since most of that code is of such poor quality. I was looking through the JS FAQ for any...
8
by: Spartanicus | last post by:
The document at http://homepage.ntlworld.com/spartanicus/custom_dtd.htm uses a custom DTD, the w3c validator validates it but with this warning: "Unknown Parse Mode! The MIME Media Type...
17
by: B. Williams | last post by:
I am receiving two warnings in my code and can't figure out why. Will someone look at this and tell me what I have done wrong? #include <iostream> using std::cout; #include <string> ...
0
by: U S Contractors Offering Service A Non-profit | last post by:
Brilliant technology helping those most in need Inbox Reply U S Contractors Offering Service A Non-profit show details 10:37 pm (1 hour ago) Brilliant technology helping those most in need ...
4
by: lucavilla | last post by:
If you go to http://europe.nokia.com/A4305060, fill the "Enter your product code:" field with the value "0523183" and press "Go" (the ending page URL varies because there's a variable session-ID in...
6
by: geevaa | last post by:
Hi Group, The page 167 of book Learning PHP5 by David Sklar says that setcookie() and session_start() must be added before any output. I tried to use that functions at last line but no warning!....
5
by: nasse | last post by:
I am getting the following error msg whenever I try to login. I tried to turn my output_buffering = On in my php.ini but is not working for me. Would you please help me: Warning: Cannot modify...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.