For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
Download from Wow! eBook <www.wowebook.com>
iv
Contents at a Glance
About the Author ........................................................................................................ x
About the Technical Reviewer ................................................................................... xi
Acknowledgments .................................................................................................... xii
Introduction ............................................................................................................. xiii
■Chapter 1: Introduction ........................................................................................... 1
■Chapter 2: Integrating jQuery into SharePoint ........................................................ 7
■Chapter 3: Common jQuery Features, Actions, and Methods ............................... 27
■Chapter 4: Debugging jQuery ................................................................................. 75
■Chapter 5: Viewing SharePoint Data Using jQuery ................................................ 85
■Chapter 6: Building a Task List Viewer Application Page .................................... 107
■Chapter 7: Adding Controls to Create, Edit, and Delete Tasks ............................. 133
■Chapter 8: Enhancing SharePoint with jQuery..................................................... 153
■Chapter 9: Using jQuery Plug-ins to Enhance SharePoint ................................... 177
■Chapter 10: Extending jQuery .............................................................................. 227
Index ....................................................................................................................... 255
xiii
Introduction
In 2009, Lightning Tools decided to take one of its best-selling products, a desktop application, and put it
into the browser as an application page in SharePoint—which turned out to be quite a challenge. When
we were looking at technologies to use, jQuery stood out as something that could be really helpful.
We spent a lot of time trying to understand how to make SharePoint and jQuery work together
initially, and then we started to learn what jQuery actually could do. Finding the information we needed
was often a struggle (not as many blogs on the topic were available at the time), but ultimately we
successfully created our product.
I learned so much about jQuery that I jumped at the chance to talk about SharePoint and jQuery
when the opportunity arose to speak about them at SPTechCon. I knew that so many people have
needed, and will continue to need, to create a client-side solution in SharePoint using jQuery, and I
wanted to share the benefit of my experience. In my talk I tried to communicate where to start and how
to explore what SharePoint with jQuery can do—and the feedback from the full room at SPTechCon was
positive.
When I was approached by Jonathan Hassell to write this book at SPTechCon in Boston in 2011, I
leapt at the chance. I wanted to write the book that I really could have used when I first started. I hope
your experience with this book is like learning to ride a bike: taking you from your first time in the seat
and getting acquainted with the controls to doing a lap around the neighborhood without training
wheels.
Who This Book Is For
This book is primarily written for SharePoint developers who are looking to expand their knowledge into
working with jQuery. SharePoint and jQuery is for intermediate programmers interested in building rich,
interactive web parts, application pages, and more using the combined power of jQuery and SharePoint.
jQuery is one of those technologies that has been around for a few years, and the kind of functionality it
offers is really quite amazing. Many of the “slick” web sites these days have a splash of jQuery in their
mix; if you want to bring this kind of dazzle to SharePoint, then this book is for you.
How This Book Is Structured
Pro SharePoint and jQuery will introduce to you some of the basics of jQuery, starting with what jQuery
is and looking at some of the advantages it offers over writing pure JavaScript. Then you will see some of
the different ways that jQuery can be deployed to your SharePoint environment. Activating jQuery to
make the library available on the page to your jQuery-consuming solutions is another task that can be
done in a multitude of ways; with this book, you will be able to compare them and figure out which one
suits your requirements. If you’re like me, wading into some examples and seeing how they work is a
great way to learn. That’s why there are lots of tasks to work through: from simply viewing information in
SharePoint with jQuery to building a complete Task Viewer application that demonstrates some key
principles of working with SharePoint and jQuery. Once you have learned the fundamentals, you will
learn how to work with plug-ins such as the jQuery UI library, and then you’ll go on to create your own.
■ INTRODUCTION
xiv
Coding Conventions
When writing production-standard code, you should always make sure that you handle exceptions
correctly and log errors when required. This book omits these steps for brevity.
The examples in this book are complete and will allow you to get a functional result that you can use
for further experimentation.
Prerequisites
You should be familiar with concepts such as SharePoint solutions, features, the SharePoint root, lists,
and libraries. You should also have some knowledge of working with JavaScript. C# developers will see
that jQuery is not too different from C#, but it is worth knowing where the differences are. Readers will
also need to have some experience working with Visual Studio, because it is used for most of the
development work.
Downloading the Code
The source code is available on the Apress web site (www.apress.com). Simply navigate to the book and
click the Source Code/Downloads tab.
Contacting the Author
If you have any questions regarding this book’s source code, are in need of clarification for a given
example, or simply want to offer your thoughts regarding SharePoint with jQuery, feel free to drop me a
line at mail@phillduffy.com , Skype me at phill.duffy, or even follow me on Twitter at
http://twitter.com/phillduffy. I’ll do my very best to get back to you as soon as possible; I’ll let you
know that I’ve received your message, but it may take a little time for me to respond in full. Finally, thank
you for buying this book. I hope you enjoy reading it and putting your newfound knowledge to good use.