Tag Archives: Intellisense

Javascript intellisense, SharePoint example

A colleague of mine gave me a great tip for adding intellisense for javascript when building your webpages. Simply add the following code to the page, inside the asp:content tag:

<asp:PlaceHolder ID="PlaceHolder1" runat="server" Visible="false">
    <script type="text/javascript" src="file://fileLocation\fileName.js" />
</asp:PlaceHolder>

Replace the src value to the scriptfile which contain the code you need. Below is an example which gives a lot of useful SharePoint intellisense-options when writing javascripts. I’m sure there are plenty of other good examples out there.

<asp:PlaceHolder ID="PlaceHolder1" runat="server" Visible="false">
    <script type="text/javascript" src="file://C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\MicrosoftAjax.js" />
    <script type="text/javascript" src="file://C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\SP.Runtime.debug.js" />
    <script type="text/javascript" src="file://C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14 \TEMPLATE\LAYOUTS\SP.debug.js" />
    <script type="text/javascript" src="file://C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\SP.Core.debug.js" />
    <script type="text/javascript" src="file://C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14 \TEMPLATE\LAYOUTS\SP.Ribbon.debug.js" />
</asp:PlaceHolder>
Advertisements