ThreeRavens
02-09-2006, 03:13 PM
Iam trying to dynamicaly create some iframes based on the the screen res of the user's monitor...here is the code:
<script language="JavaScript">
var scr_width= screen.width;
var scr_height= screen.height;
var iframe_height = 0;
if(scr_height == 1280)
{iframe_height=1000;}
else if(scr_height==1024)
{iframe_height=1000;}
else{iframe_height=600;}
alert(iframe_height+'-'+scr_height+'x'+scr_width);
document.write('<iframe src="functions/reports/reports_circuit.cfm?fuseaction=reports" name="body_frame" width="100%" marginwidth="0" height="'+iframe_height+'" marginheight="0" align="top" scrolling="auto" frameborder="0" class="inside2CIframe2" allowtransparency="true"></iframe>');
</script>
the alert (put in for testing purposes) returns "600-undefinedxundefined" Why is it returning undefined?
HELP!!!!! *as I bang my head agaisnt the monitor* hehehe
Eric
<script language="JavaScript">
var scr_width= screen.width;
var scr_height= screen.height;
var iframe_height = 0;
if(scr_height == 1280)
{iframe_height=1000;}
else if(scr_height==1024)
{iframe_height=1000;}
else{iframe_height=600;}
alert(iframe_height+'-'+scr_height+'x'+scr_width);
document.write('<iframe src="functions/reports/reports_circuit.cfm?fuseaction=reports" name="body_frame" width="100%" marginwidth="0" height="'+iframe_height+'" marginheight="0" align="top" scrolling="auto" frameborder="0" class="inside2CIframe2" allowtransparency="true"></iframe>');
</script>
the alert (put in for testing purposes) returns "600-undefinedxundefined" Why is it returning undefined?
HELP!!!!! *as I bang my head agaisnt the monitor* hehehe
Eric