how to add Javascript and CSS in page layout with sharepoint 2013
来源:互联网 发布:淘宝网个人中心 编辑:程序博客网 时间:2024/06/05 23:55
how to add Javascript and CSS in page layout with sharepoint 2013
Sometimes, we need create a custom page layout, at the time, if we want to add some javascript and css code, how to do it? we cannot add the code in page layout file directly, the syetem will filter it and the code lost function. follow my steps to resolve it.
1. Open the page layout file, it is html file
2. you must add the javascript and css under the label <!--MS:<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server">-->. find the label
<!--MS:<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server">--> <!--ME:</asp:ContentPlaceHolder>-->
3. You need handle your css label when add css label, or the css will be filter, the correct css label is :
<!-- MS:<style type="text/css" >--> // add your css code<!--ME: </style>-->
4. Add javascript code, but you need focus on the document.ready, the document.ready will lost function for page layout is heriting from master page, so the body loading is difference. you must use the function named "_spBodyOnLoadFunctionNames.push"
<script> _spBodyOnLoadFunctionNames.push("cutomFunction");function cutomFunction(){// ...}</script>
Besides, we need hdie the master page in dialog,you have to add extra class in matser: <div class="s4-notdlg">this section won't </div>,
and you can add new app in custom master page, you need to add the follow control in s4-workspace:
<div style="display:none;"> <!--SPM:<SharePoint:AjaxDelta id="DeltaPlaceHolderLeftNavBar" BlockElement="true" runat="server">--> <!--SPM:<asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server">--> <!--SPM:</asp:ContentPlaceHolder>--> <!--SPM:</SharePoint:AjaxDelta>--> <!--SPM:<SharePoint:AjaxDelta id="DeltaPlaceHolderPageTitleInTitleArea" runat="server">--> <!--SPM:<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server">--> <!--SPM:</asp:ContentPlaceHolder>--> <!--SPM:</SharePoint:AjaxDelta>--> </div>
0 0
- how to add Javascript and CSS in page layout with sharepoint 2013
- How to Add onLoad JavaScript event in SharePoint?
- How to implement scrolling image with javascript in web page
- How to add custom fields to Customer Registration and Account page in magento
- How to create your own custom 404 error page and handle redirect in SharePoint 2007 (MOSS)?
- How to create your own custom 404 error page and handle redirect in SharePoint
- How to redirect page in JavaScript
- How to add css class and id in @Html.TextBox mvc4 at the same time
- How to Load XML with JavaScript on an HTML5 Page
- How to redirect to a Custom Page for Event Receiver in SharePoint 2010
- How to add dividers and spaces between items in RecyclerView?
- how to install and configure Remote BLOB Storage (RBS) in a SharePoint 2013 farm
- 【LaTeX】How To Add Page Numbers
- How-to-design-and-deploy-a-new-master-page-for-sharepoint-2010
- How to add a new user in linux and add it to a new group
- How to use Comparator and Comparable in Java? With example
- How to log in Spring with SLF4J and Logback
- How to log in Spring with SLF4J and Logback
- html页面中打印样式
- 黑魔法__attribute__((cleanup))
- TCP的三次握手、四次挥手
- 教你创建高大上的多边形字体
- matlab产生随机数
- how to add Javascript and CSS in page layout with sharepoint 2013
- struts 2 的SessionAware接口使用
- 检测当前是否联网
- 【Oracle篇】管理常用对象
- 玄幻的图像处理效果
- TURF: New Methods for Implementation
- 五大标准化的方法来编写CSS
- Intro.js – 为您的网站提供更好的用户指引
- vsd/jpg/emf/fig 转 eps