View Full Version : Newbie Question
Bracolla
12-31-2004, 06:32 PM
I need to add the following to the <BODY> tag:
<body onLoad="if (document.all&&window.print) readymessage()">
but the <Body> tag already contains <body onload="init()">
How can I combine both?
simonf
01-06-2005, 06:38 AM
<body onLoad="if (document.all&&window.print) readymessage()", "init()">
should work, rgds,Simonf;)
mwinter
01-06-2005, 12:09 PM
<body onLoad="if (document.all&&window.print) readymessage()", "init()">
should workNo, it shouldn't.
<body onload="if(document.all && window.print){readymessage();}init();">
However, if the if statement is meant to detect IE, it would be better to use Internet Explorer's conditional comments:
<body onload="init();">
<!--[if IE]>
<script type="text/javascript">
(function(fn) {
window.onload = function() {
readymessage();
if(fn) {fn();}
};
})(window.onload);
</script>
<![endif]-->
[Untested]
Mike
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.