JavaScript in Quick Launch and Top Link Bar in sharepoint 2010:

JavaScript in Quick Launch and Top Link Bar in sharepoint 2010:

You can add javascript functions in you quick launch and top navigation bar.(for creating some alert messages)

Step-1:

      go to siteactions->site settings->Lookand Feel->Quick Launch bar->New Navigation link->
(There add the java script function in new link... ex-JavaScript:alert('Hello world!')) See the below image.
 Step-2:

    Click ok, and go to home page and  click on newly created quick launch link.Your alert message will appear.



Error:

     If sharepoint publishing infrastructer is activated in your site then it will show error like follow

How to check that->(Go to Site Actions-> Site Settings->Look and Feel-> and see if you have “Quick Launch” or “Navigation”.  “Navigation” is for publishing sites)
If you Have Navigation then it wont work.

How to Deactivate that Publishing Feature:

           Site Actions->Site Settings->Site collection Administration->Site collection Features->sharepoint server publishing infrastructure(Deactivate this)
And again you can activate this.that time the javascript function work..

Refrence:

 Pls refer this link http://techtrainingnotes.blogspot.in/2010/10/sharepoint-javascript-in-quick-launch.html

Comments

Popular posts from this blog

Upload Single/Multiple file by using the REST API and jQuery SharePoint 2013

Add content type to SharePoint List/Library using REST API

A type named 'SP.Data. could not be resolved by the model error