Why method 1 is right and workes,
but method 2 is not right?
Method 1:
<script language="JavaScript">
sw = screen.width;
sh = screen.height;
document.write(sw);
if (sw == 1024)
document.body.background = "background.jpg"
</script>
Method 2:
<script language="JavaScript">
sw = screen.width;
sh = screen.height;
if (sw == 1024)
document.body.background = "background.jpg"
</script>
but method 2 is not right?
Method 1:
<script language="JavaScript">
sw = screen.width;
sh = screen.height;
document.write(sw);
if (sw == 1024)
document.body.background = "background.jpg"
</script>
Method 2:
<script language="JavaScript">
sw = screen.width;
sh = screen.height;
if (sw == 1024)
document.body.background = "background.jpg"
</script>