O'Reilly Forums: Chapter 1 - O'Reilly Forums

Jump to content

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

Chapter 1

#1 User is offline   nanonerd 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 30-October 11

Posted 30 October 2011 - 02:33 PM

Greetings from Brigantine, NJ ... ;-)

I just finished Chapter one. Pretty cool and clear cut. The method of teaching is quite intriguing with all the pictures, etc. I like it, so far !

QUESTION: page 9, in the 2nd jQuery example, it uses the same exact code as the first ... but what if you only wanted to "Change the page" in the first 5 "p" elements as it does in the FOR Loop in the javascript example?

Doesn't *** $("p").html("Change the page."); *** change all the "p" elements?

QUESTION: page 16, a minor typo? is the first jQuery statement in the first cloud missing a semi-colon?

QUESTION: page 17, bottom, are elements allowed to have the same id in the same page? <p id="mytext"> is shown twice ... just curious ... a simple "yes" or "no" will suffice ... i'm no expert on HTML but from a conceptual point, I just assumed that an ID is usually to keep something unique ...
0

#2 User is offline   LongLiveCHIEF 

  • Active Member
  • PipPip
  • Group: Members
  • Posts: 20
  • Joined: 20-July 10

Posted 27 February 2012 - 10:35 PM

Question 1: You are correct, in the javascript example the use the zeroth element of that object type, whereas in the jQuery example, they oversimplified it to convey a point. You would need to add a first-child filter to the selector to duplicate the results.

Question 2: It's also missing a closing parenthesis. It should be $("button").click(function(){});

Question 3: ID's should be unique by conventional standards, but nothing stops people from doing it, and the browser won't even go into quirks mode with this.

This post has been edited by LongLiveCHIEF: 27 February 2012 - 11:26 PM

0

#3 User is offline   LongLiveCHIEF 

  • Active Member
  • PipPip
  • Group: Members
  • Posts: 20
  • Joined: 20-July 10

Posted 28 February 2012 - 06:18 AM

View PostLongLiveCHIEF, on 27 February 2012 - 10:35 PM, said:

Question 1: You are correct, in the javascript example the use the zeroth element of that object type, whereas in the jQuery example, they oversimplified it to convey a point. You would need to add a first-child filter to the selector to duplicate the results.

Question 2: It's also missing a closing parenthesis. It should be $("button").click(function(){});

Question 3: ID's should be unique by conventional standards, but nothing stops people from doing it, and the browser won't even go into quirks mode with this.


And by first child, I really mean eq filter. :)
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