<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SharePoint Fun &#187; Javascript</title>
	<atom:link href="http://blog.qumsieh.ca/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.qumsieh.ca</link>
	<description>Developer's blog related to ASP.NET, SharePoint and Telerik Web Controls</description>
	<lastBuildDate>Fri, 27 Jan 2012 19:08:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to Use Prototype and Script.aculo.us in SharePoint</title>
		<link>http://blog.qumsieh.ca/2008/06/28/how-to-use-prototype-and-script-aculo-us-in-sharepoint/</link>
		<comments>http://blog.qumsieh.ca/2008/06/28/how-to-use-prototype-and-script-aculo-us-in-sharepoint/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 01:46:20 +0000</pubDate>
		<dc:creator>shereen</dc:creator>
				<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://blog.qumsieh.ca/?p=127</guid>
		<description><![CDATA[What is Script.aculo.us? Script.aculo.us gives developers a new way to code in JavaScript by providing new shortcut functions, new powerful objects including Form, Effect, Control and Ajax, and some custom widgets. It&#8217;s an add-on to the Prototype.js JavaScript library. What is Prototype? Prototype by itself is a very well thought out and implemented library of [...]]]></description>
			<content:encoded><![CDATA[<p>What is <strong>Script.aculo.us</strong>?</p>
<p><strong>Script.aculo.us</strong> gives developers a new way to code in JavaScript by providing new shortcut functions, new powerful objects including Form, Effect, Control and Ajax, and some custom widgets. It&#8217;s an add-on to the Prototype.js JavaScript library.</p>
<p>What is <strong>Prototype</strong>?</p>
<p><strong>Prototype</strong> by itself is a very well thought out and implemented library of JavaScript methods that helps a great deal with creating rich, highly interactive, and dynamic web pages.</p>
<p>The focus of this article will be to get you started using these two frameworks in your SharePoint projects. It&#8217;s really simple to do, and the frameworks themselves are not that difficult to learn.</p>
<p>Let&#8217;s begin:</p>
<ol>
<li>Download the files from <a href="http://www.prototypejs.org/download">http://www.prototypejs.org/download</a> and <a href="http://script.aculo.us/downloads">http://script.aculo.us/downloads</a>. The prototypejs download is a single file. The Script.aculo.us download is a zip archive with several files included.</li>
<li>Extract the Script.aculo.us files to your project directory where they can be referenced. Place the prototype file there as well. In my case, I was developing a custom application page within MOSS. I placed the files in that layouts folder where my custom application pages were located.

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="console" style="font-family:monospace;">C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\CustomApplicationPages\</pre></td></tr></table></div>

</li>
<li>Inside your project files you only have to include 2 files. The prototype.js file and the scriptaculous.js file. The scriptaculous.js file will load all the other necessary js files for you. Within my custom application page, I added my script tags just after the main content placeholder as follows:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;asp:Content</span> <span style="color: #000066;">ID</span>=<span style="color: #ff0000;">&quot;Main&quot;</span> <span style="color: #000066;">ContentPlaceHolderID</span>=<span style="color: #ff0000;">&quot;PlaceHolderMain&quot;</span> <span style="color: #000066;">runat</span>=<span style="color: #ff0000;">&quot;server&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;prototype.js&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;scriptaculous.js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

</li>
<li>Now within my custom appliation pages, I can leverage the frameworks to make my pages do some cool things. An example of how to use it:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">onclick</span>=<span style="color: #ff0000;">&quot;new Effect.Appear('nameHelp')&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Appear<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;nameHelp&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">'display:none;overflow: auto;'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Some content here.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

</li>
</ol>
<p>This example is just a small example of what you can do. Check out the Script.aculo.us and Prototype documentation for an idea of what else is possible. If you&#8217;re having any trouble getting this going, just drop me a note.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.qumsieh.ca/2008/06/28/how-to-use-prototype-and-script-aculo-us-in-sharepoint/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

