p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning JavaScript 5th Edition (http://p2p.wrox.com/forumdisplay.php?f=793)
-   -   Ch1 (http://p2p.wrox.com/showthread.php?t=98776)

SHOOGN April 3rd, 2016 10:04 AM

Ch1
 
When I open the page in browser the red color not appear to me in Example 1
Code:

<script type="text/javascript">
// script 2
alert("Second script block");
document.background="red";
</script>


SHOOGN April 3rd, 2016 10:08 AM

Sorry
I fix the problem
I should use bgColor instead of background
But I Have Q:I java Script Case Sensitive

webmachine February 4th, 2017 02:22 PM

bgColor is an obsolete attribute in html5
 
I downloaded ch. 1 of this book in my search for a good book to review JavaScript. It looks like good one, but already in chapter 1 I have come across code that doesn't work for me, because 'bgcolor' has been made obsolete in html5. Why is a new version of a coding book using obsolete code?

BTW, I searched online and found that it should be document.body.style.backgroundColor

I still think this is a great book, and will buy the online version, but this code disappointed me, because I was really depending on something that was up-to-date.


All times are GMT -4. The time now is 03:49 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.