2013-12-17 116 views
0

我嘗試使用JCOM將文檔上傳到Sharepoint文檔庫,但我遇到元數據問題:瀏覽器控制檯說「TypeError:SP.FileCreationInformation不是構造函數」 on「this.fi = new SP.FileCreationInformation();」在javascript客戶端對象模型中的SharePoint 2010 SP.FileCreationInformation()

<SharePoint:ScriptLink ID="ScriptLink1" runat="server" Name="SP.js" Localizable="false" OnDemand="False" LoadAfterUI="True"></SharePoint:ScriptLink> 
<SharePoint:ScriptLink ID="ScriptLink2" runat="server" Name="SP.Core.js" Localizable="false" OnDemand="False" LoadAfterUI="True"></SharePoint:ScriptLink> 
<SharePoint:ScriptLink ID="ScriptLink3" runat="server" Name="SP.Runtime.js" Localizable="false" OnDemand="False" LoadAfterUI="True"></SharePoint:ScriptLink> 
<SharePoint:ScriptLink ID="ScriptLink4" runat="server" Name="SP.Debug.js" Localizable="false" OnDemand="False" LoadAfterUI="True"></SharePoint:ScriptLink> 

<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> 

<script type="text/javascript"> 
    $(document).ready(
     function() { 
      ExecuteOrDelayUntilScriptLoaded(DDLBindData, "sp.js"); 
     } 
    ); 

    var array = []; 
    var counter = 1; 

    function DDLBindData() { 
     var clientContext = new SP.ClientContext.get_current(); 
     var web = clientContext.get_web(); 

     clientContext.load(web); 
     clientContext.executeQueryAsync(Function.createDelegate(this, this.OnQuerySucceeded), Function.createDelegate(this, this.OnQueryFailed)); 

     this.listCollection = web.get_lists(); 
     this.list = this.listCollection.getByTitle("TestLib"); 
     this.contentTypeCollection = this.list.get_contentTypes(); 

     this.fi = new SP.FileCreationInformation(); 

     clientContext.load(this.contentTypeCollection); 
     clientContext.executeQueryAsync(Function.createDelegate(this, this.OnQuerySucceeded), Function.createDelegate(this, this.OnQueryFailed)); 
    } 

但intellisence告訴我其他梅託德像FileCreationInformation

回答

相關問題