Troubleshoot: SharePoint 2013: executeordelayuntilscriptloaded

Source: Internet
Author: User

Executeordelayuntilscriptloaded in SharePoint 2010 has no effect during use in 2013.

Example:

SharePoint 2013 code:

Sp.sod.exe cutefunc ('SP. js', 'SP. clientcontext', sharepointready );

Function implements pointready () {alert ("ready ");}

SharePoint 2010 code:

Executeordelayuntilscriptloaded (sharepointready, "sp. js ");

Function implements pointready () {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

Troubleshoot: SharePoint 2013: executeordelayuntilscriptloaded

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.