Here i will explain how to import the external java script file into specified share point site web page.To add the file reference by using a class "script link" which will be used to request scripts by the time of page rendered in share point 2010.We will add the reference both client side and sever side to page using this below piece of code.
Client Side:
By using the below method we can access script on server side.The Register method contains the there variable which are page name,script file name and localizable value .
Client Side:
<SharePoint:ScriptLink ID="sl" name="/_layouts/Jscripts/testadd.js" runat="server" Defer="false"/>Server Side:
By using the below method we can access script on server side.The Register method contains the there variable which are page name,script file name and localizable value .
ScriptLink.Register(this.Page, "/_layouts/Jscripts/testadd.js", false);
No comments:
Post a Comment