O'Reilly logo

SharePoint 2010 at Work by Mark Miller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. jQuery to the Rescue

Jim Bob Howard

It seems like every time I turn around, I have a project that reaches just beyond what SharePoint will do with out-of-the-box (OOB) functionality. And just about every time that happens, jQuery comes to the rescue to make the job easy, elegant, and robust.

Because SharePoint uses web technologies, we’re blessed with being able to use JavaScript to manipulate the presentation layer programmatically. One of the most popular JavaScript libraries today is called jQuery. jQuery gives us an easy way to manipulate the document object model (DOM) of the web pages created by SharePoint. This all happens in the browser after the page has been served up and rendered. But, it’s so fast, many of its features appear to happen on load. Others can be utilized with JavaScript to allow the page to change based on user interaction.

In this chapter, I’ve only touched the tip of the iceberg by showing some examples in which you can use jQuery for some great, easy-to-use functionality. When you’re done with this chapter, you will know how to use jQuery to effect the following changes on your pages:

Automate all-day events

When you want all of your Calendar entries to be an all-day event, this little lesson shows you how to check the box automatically and then hide it so the user can’t change it. The example here is a Mileage Report submission calendar, where only the date matters and not the time of day.

Requesting a review only once

Sometimes you want to solicit ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required