473,569 Members | 2,522 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Inconsistent window.print behavior in Netscape and IE6

I have a JSP page on which when print is pressed - Records are fetched
on a redirected page and those are to be printed.
I use the lines -
<script language="javas cript">
window.print();
history.back();
</script>
to do the same.

When browsed from Netscape 4.7, the Resultset page is printed
perfectly whereas in IE6, the resultset page is generated and the
source page is printed i.e. the one where Print command was given

Is there a workaround for IE6 for the same which will let me print the
Result page silently without changing the sequence of operations for
the user?

Mar 20 '07 #1
1 1947
On Mar 20, 7:04 am, "Prasoon" <prasoon.gu...@ gmail.comwrote:
I have a JSP page on which when print is pressed - Records are fetched
on a redirected page and those are to be printed.
I use the lines -
<script language="javas cript">
Replace this with <script type="text/javascript">.
window.print();
history.back();
</script>
to do the same.

When browsed from Netscape 4.7, the Resultset page is printed
perfectly whereas in IE6, the resultset page is generated and the
source page is printed i.e. the one where Print command was given

Is there a workaround for IE6 for the same which will let me print the
Result page silently without changing the sequence of operations for
the user?
Your code is getting run inline. What you should do is put your code
inside a function block and call that function from the onload event
handler:

<script type="text/javascript">

function doPrint() {
window.print();
history.back();
}

</script>

<body onload="doPrint ();">
....
</body>

HTH.
Mar 20 '07 #2

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

Similar topics

2
4632
by: Jawahar Rajan | last post by:
All, I have a printer friendly page that is opened when a user clicks a link on my page to get the printer friendly version, How ever when they close out the printer friendly version and return to the original page the mouse cursor is a Hour glass shape! my code: I use DIV tag <DIV id ="printThis"> <%
1
7840
by: John | last post by:
I am having a problem with window.print in a popup window. I am creating 2 popup windows both with a print button in them, 1 works the other doesn't. Code runs in a javascript function on a webpage. Here is the difference : First example (works) - ...
3
1818
by: Hermit Crab | last post by:
I'm seeing some unexpected (at least to me) behavior in the 'window' and 'document' objects under Netscape 7.1 and Internet Explorer 6.0. When a property is added to the prototype for 'Object', it was my understanding that it should be visible to all objects. But it appears that it is NOT visible in the 'window' object of either IE or...
9
1755
by: Christopher Benson-Manica | last post by:
In some old Javascript we have, we try to determine whether the client is IE or Netscape (assume for the purposes of this question that the question can be resolved satisfactorily) and tailor the script to it: var myOpen=open(url, 'subWin', 'width=600, height=400,*A*resizable=1,scrollbars=1' ); if ( myOpen && !myOpen.closed ) {...
1
1675
by: The Pistoleer | last post by:
I have an inconsistent problem with some Internet pages when using Netscape (7.1) that I cannot reproduce with IE nor locally. Below is an example link. There are several tables on the pages. The tables at the top containing small images are working correctly. The tables below that contain product descriptions and input to purchase an...
2
1596
by: Bell, Kevin | last post by:
The following works in the interactive window of PythonWin, but fails in a script. TypeError: Objects of type 'slice' can not be converted to a COM VARIANT I just need to parse out these dates, but it's making me crazy. Shouldn't it work in both the interactive window and a script? >>> d = "5-18-05 to 5-31-05" >>> print d
2
12539
by: Matt | last post by:
When we submit the form data to another page, we usually do the following: <form action="display.aspx" method="post"> will submit the form data and open display.asp in the current browser <form action="display.aspx" method="post" target="_blank"> will submit the form data and open display.asp in a new browser
22
130050
by: stephen | last post by:
I have created an order form that users javascript to create a new html document when the customers clicks the "print page" button. Once the new document has been created it then prints the document and closes it with the following code: <body onload="window.print(); window.close();"> This works correctly (or at least the way I expect...
26
5649
by: yb | last post by:
Hi, Is there a standard for the global 'window' object in browsers? For example, it supports methods such as setInterval and clearInterval, and several others. I know that w3c standardized several parts of the DOM, but this does not include the window object. Thank you
0
7701
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7677
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.