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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • daydreaming
    New Member
    • Jan 2008
    • 12

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

    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.

    Code:
    <!-- saved from url=(0014)about:internet -->
    <html>
    <head><title>Test</title>
    <script type="text/javascript">
    <!--
    function printPage(){
    var content;
    content = document.body.innerHTML;
    content = '<h1>Test</h1>';
    display(content);
    }
    
    function display(content) {
     top.consoleRef=window.open('','myconsole','width=800,height=500,status=0,scrollbars=1,resizable=1,menubar=1,toolbar=1')
     top.consoleRef.document.writeln('\<!-- saved from url=(0014)about:internet --\>');
     top.consoleRef.document.writeln('<html><head><title>My Document</title>'
    	+ '<STYLE TYPE="text/css">'
    	+ '	H1 ' 
    	+ '			{'
    	+ '			font-family: Arial, Helvetica, sans-serif;'
    	+ '			font-size: 16px;'
    	+ '			font-style: normal;'
    	+ '			font-weight: bolder;'
    	+ '			font-variant: normal;'
    	+ '			color: White;'
    	+ '			text-align: center;'
    	+ '			text-transform: capitalize;'
    	+ '			height: 20px;'
    	+ '			background-color : #638eb9;'
    	+ '			}'	
    	+ ' </STYLE> '
    	+ ' </head>'
    	+ ' <body bgcolor=white onLoad="self.focus();window.print()">'
    	+ content
    	+ '</body></html>'
     )
     top.consoleRef.document.close()
    }
    -->
    </script>
    </head>
    <body>
    <a NAME="PRINT" HREF="javascript:printPage()"><font size="2">Click For Printable Document</font></a>
    </body>
    </html>
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    What part doesn't work in IE6? Is it just the printing part?

    Comment

    Working...