473,804 Members | 4,066 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create HTML page without active script warning message by Javascript on IE browser

12 New Member
Hi All,

I have the below code which worked as what I want on Firefox, but the code did not work on IE6. Do you guys have any suggestion for me how to fix the code below to make it work on IE? Thank you for any help in advance.

Expand|Select|Wrap|Line Numbers
  1. <!-- saved from url=(0014)about:internet -->
  2. <html>
  3. <head><title>Test</title>
  4. <script type="text/javascript">
  5. <!--
  6. function printPage(){
  7. var content;
  8. content = document.body.innerHTML;
  9. content = '<h1>Test</h1>';
  10. display(content);
  11. }
  12.  
  13. function display(content) {
  14.  top.consoleRef=window.open('','myconsole','width=800,height=500,status=0,scrollbars=1,resizable=1,menubar=1,toolbar=1')
  15.  top.consoleRef.document.writeln('\<!-- saved from url=(0014)about:internet --\>');
  16.  top.consoleRef.document.writeln('<html><head><title>My Document</title>'
  17.     + '<STYLE TYPE="text/css">'
  18.     + '    H1 ' 
  19.     + '            {'
  20.     + '            font-family: Arial, Helvetica, sans-serif;'
  21.     + '            font-size: 16px;'
  22.     + '            font-style: normal;'
  23.     + '            font-weight: bolder;'
  24.     + '            font-variant: normal;'
  25.     + '            color: White;'
  26.     + '            text-align: center;'
  27.     + '            text-transform: capitalize;'
  28.     + '            height: 20px;'
  29.     + '            background-color : #638eb9;'
  30.     + '            }'    
  31.     + ' </STYLE> '
  32.     + ' </head>'
  33.     + ' <body bgcolor=white onLoad="self.focus();window.print()">'
  34.     + content
  35.     + '</body></html>'
  36.  )
  37.  top.consoleRef.document.close()
  38. }
  39. -->
  40. </script>
  41. </head>
  42. <body>
  43. <a NAME="PRINT" HREF="javascript:printPage()"><font size="2">Click For Printable Document</font></a>
  44. </body>
  45. </html>
  46.  
Jun 14 '08 #1
1 1832
acoder
16,027 Recognized Expert Moderator MVP
What part doesn't work in IE6? Is it just the printing part?
Jun 16 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1804
by: Jake j | last post by:
To those of you who sent me working examples of js include routines, much thanks. I see from them examples that what I'm trying to get to requires a higher level of js knowledge than I've got. Here's what I'm really trying to do: I've been using a sliding banner javascript routine in several html files and it works fine. Rather than duplicate the code in each file, however, it would obviously be preferable to including the routine in...
7
7771
by: moondaddy | last post by:
I want to dynamically create a JavaScript file and cache it on the client for re-use. I know how to write javascript to a web page from the code behind, but I don't know how to actually create a file such as MyNewScript.js and then cache that on the client so all the pages of that session can use it. Can this be done? Thanks -- moondaddy@nospam.com
7
2733
by: Danny | last post by:
Hello: I would like to develop a browser extension, or whatever such a thing is classified as, that would allow a user of IE6, and possibly IE7, to switch between a live and development page. I'm sure the individuals reading this are familiar with what I'm referring to; however, I'll provide an example.
42
8969
by: Santander | last post by:
how to decode HTML pages encoded like this: http://www.long2consulting.com/seeinaction2008/Simplicity_Beach_table/index.htm Is there script that will do this automatically and generate normal fully readable HTML? Santander
0
9710
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9589
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10593
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10085
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9163
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7626
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5527
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4304
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

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.