Adding Code or JavaScript to the CEWP

Just like adding CSS styles to a CEWP, you can also add JavaScript to a CEWP. For example, in Figure 6.23, I added a snow effect to the home page of a site for the festive season using a CEWP that includes some JavaScript. Fellow SharePoint colleague and MVP, Todd Bleeker of Mindsharp, created the Web part in 2005, and it proved a popular download. The Web part still works in SharePoint 2010 sites. You can download it from http://www.mindsharpblogs.com/todd/archive/2006/12/20/1431.html.

Figure 6.23 Festive addition to a page using the CEWP and JavaScript.

image

Resource Site

You can find the snow.dwp file and snowflake ...

Get Microsoft® SharePoint® Designer 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.