O'Reilly Forums: Irock Chapter 3 - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Irock Chapter 3

#1 User is offline   af14 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 12-December 13

Posted 12 December 2013 - 02:21 PM

This example does not work unless you type it exactly as written, which wouldn't actually work in the real world. The first line in all of my other HTML pages has been <!DOCTYPE html>, but if I include this line in this example, the example doesn't work. I don't understand everything about DOCTYPE, but it seems like are some complexities to accessing the window size that are dependent on the DOCTYPE and the browser which make this example too complex for someone fairly new to HTML and JavaScript. I am a programmer learning HTML and JavaScript so I like that the book doesn't assume I've never written a line of code before, but the complexities of this example are very specific to HTML and JavaScript and beyond me.
0

#2 User is offline   Spotted_Dog 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 26-December 13

Posted 26 December 2013 - 11:00 AM

I too have the same issue in the latest versions of Chrome, Firefox and Safari. Not having the <!DOCTYPE html> at the top makes the file not valid (w3 validation fails). This issue is answered here in the forums.

View Postaf14, on 12 December 2013 - 02:21 PM, said:

This example does not work unless you type it exactly as written, which wouldn't actually work in the real world. The first line in all of my other HTML pages has been <!DOCTYPE html>, but if I include this line in this example, the example doesn't work. I don't understand everything about DOCTYPE, but it seems like are some complexities to accessing the window size that are dependent on the DOCTYPE and the browser which make this example too complex for someone fairly new to HTML and JavaScript. I am a programmer learning HTML and JavaScript so I like that the book doesn't assume I've never written a line of code before, but the complexities of this example are very specific to HTML and JavaScript and beyond me.

This post has been edited by Spotted_Dog: 26 December 2013 - 11:10 AM

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users