SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Jquery Noivice to Ninja 2nd ed getting two particular examples to work

    chapter 7
    11_star_rating
    The code on page 270 does not work as intended. Its puts the attribute 'checked' in all radio buttons. Surely what is required is to put the said attribute in only one radio button and clear it from the rest.
    18_simple_modal.dialog
    I can't get closeDialog() to work.
    For both examples I have not, so far, been unable to discover why the given error code is in error.

  2. #2
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found that I can get 18_simple.modal.dialog to work by substituting the function' live 'for the three occurrences of 'on' in the closeDialog() function

  3. #3
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,131
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Just wanted to point this out, as I'm not sure which version of jQuery the book was written for, but as of 1.7 jQuery deprecated the live() event for the use of on()
    http://api.jquery.com/live/

    As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers. Users of older versions of jQuery should use .delegate() in preference to .live().

  4. #4
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I know this but how to make it work with 'on. I using second edition.

    Quote Originally Posted by cpradio View Post
    Just wanted to point this out, as I'm not sure which version of jQuery the book was written for, but as of 1.7 jQuery deprecated the live() event for the use of on()
    http://api.jquery.com/live/
    I know this but how to make it work with 'on. I am using the second edition.Anyway thank you for the interest.

  5. #5
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,131
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    I've recently got a copy of the book, hopefully I can take a look at it this weekend to see if I can't help you figure it out.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •