Forum Moderators: open
//Set NS6 to false in case it is skipped in the if (!IE4)
NS6=false;//detect Internet explorer 4 - If document.all returns TRUE, then program
//is compatible for IE4
IE4=(document.all);
//If it's not IE4 detect for Netscape six. If getElementByID returns ture, program
//is compatible for Netscape 6
if (!IE4) {
NS6=(document.getElementById);
}
//detect Netscape 4 - If document.layers is TRUE, program is compatible for NS4
NS4=(document.layers);
function createLayer (name, xpos, ypos, content) {
//***********************************************************************************
if (NS4) {
document.write('<LAYER NAME="'+name+'" LEFT="'+xpos+'" TOP="'+ypos+'">');
}
if ((IE4) ¦¦ (NS6)) {
document.write(' <div id="'+name+'" style="position:absolute; left: '+xpos+
' ; top: '+ypos+
' ;"> ' );
}
//*************************************************************************************
/*
I've tried doing it this way as well:
document.write ("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'");
document.write ("codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='350' height='300'>");
document.write ("<param name='movie' value='cannonshoot.swf'>");
document.write ("<param name='quality' value='high'>");
document.write ("<param name='wmode' value='transparent'>");
document.write ("<embed src='cannonshoot.swf' width='350' height='300' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' wmode='transparent'>");
document.write ("</embed></object>");
}
And also have tried the following way:*/
var cannonInfo = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="350" height="300"><param name="movie" value="cannonshoot.swf"><param name="quality" value="high"><param name="wmode" value="transparent"><embed src="cannonshoot.swf" width="350" height="300" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed></object>';
document.write (cannonInfo);
//*************************************************************************************
if (NS4) {
document.write('</LAYER>');
}
if ((IE4) ¦¦ (NS6)) {
document.write('</DIV>');
}
}
document.write ("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'");
document.write ("codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='350' height='300'>");
Consider making those one single line.