We have already displayed the posts and a link to view comments with each post. Each of these links has a CSS class
named viewComments
. In the init
method, we have defined an event handler for the click
event on this selector. This event handler calls the method getJSONFromAPI
with two arguments. The first argument is the set of string comments that will let getJSONFromAPI
know that the API request has to be made for comments. The second parameter is the comments id
for that particular post, which we assigned using the data-commentsid
attribute. The event handler for viewComments
gets this value and passes it as a second argument to getJSONFromAPI
. We have already defined and discussed the working of getJSONFromAPI
. This method will request the API for comments and will call the displayComments
method with the API response as an argument. Since we are going to display the comments in a dialog, the event handler for the viewComments
selector opens the dialog box...
Mastering jQuery UI
By :
Mastering jQuery UI
By:
Overview of this book
Table of Contents (19 chapters)
Mastering jQuery UI
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
Designing a Simple Quiz Application
Building a Jigsaw Puzzle Game
Creating a Website Tour
Creating a Tabbed News Reader
Implementing CAPTCHA using Draggable and Droppable
Creating an Event Timeline Using a Slider
Using jQuery UI with Google Maps API
Creating a Photo Album Manager
Creating Widgets Using the Widget Factory
Building a Color Picker with Hex RGB Conversion
Creating a Fully Functional Dashboard
Best Practices for Developing with jQuery UI
Index
Customer Reviews