zoukankan      html  css  js  c++  java
  • TroubleShoot: SharePoint 2013: ExecuteOrDelayUntilScriptLoaded 页面发布后不执行的问题

    SharePoint 2010 中的ExecuteOrDelayUntilScriptLoaded,在2013 中使用时没有效果的问题。

    Example:

    SharePoint 2013 Code:

    SP.SOD.executeFunc('sp.js', 'SP.ClientContext', sharePointReady);

    function sharePointReady() {    alert("Ready"); }

    SharePoint 2010 Code:

    ExecuteOrDelayUntilScriptLoaded(sharePointReady, "sp.js");

    function sharePointReady() {    alert("Ready"); }

    <script type="text/javascript">
    ExecuteOrDelayUntilScriptLoaded(GetIdeaItemCount,"sp.js");
    var list;
    function GetIdeaItemCount()
    {
    var context = new SP.ClientContext.get_current();
    var web = context.get_web();
    list = web.get_lists().getByTitle('TestFormLib');
    context.load(list);
    context.executeQueryAsync(Function.createDelegate(this, this.GetSuccess), Function.createDelegate(this, this.GetFailed));
    }
    
    function GetSuccess(){
      document.getElementById("spListItemCount").innerText=list.get_itemCount();
    }
    function GetFailed(sender,args)
    {
      alert('failed. Message:' + args.get_message()); 
    }
    
    </script>
    View Code

    Refer: http://msdn.microsoft.com/en-us/library/jj245759.aspx

    出处: http://www.cnblogs.com/windy2008

  • 相关阅读:
    ubuntu使用iso作为本地源
    ubuntu配置简单的DNS服务器
    core data
    Core Animation教程
    制作framework&静态库
    notes
    textkit
    coretext
    nsset
    iOS Development Sites
  • 原文地址:https://www.cnblogs.com/windy2008/p/4074002.html
Copyright © 2011-2022 走看看