I am trying to get my webparts on my page by title, on get_title().
I get the error:
object does not support
get_Title()
ExecuteOrDelayUntilScriptLoaded(init,'SP.js'); function init(){ var clientContext = new SP.ClientContext.get_current(); var web = clientContext.get_web(); var theURL = window.location.pathname; var oFile = web.getFileByServerRelativeUrl(theURL); var limitedWebPartManager = oFile.getLimitedWebPartManager(SP.WebParts.PersonalizationScope.shared); var collWebPart = limitedWebPartManager.get_webParts(); clientContext.load(collWebPart); clientContext.executeQueryAsync(function () { var Enumerator = collWebPart.getEnumerator(); while (Enumerator.moveNext()) { var enumTitle = Enumerator.get_current(); alert(enumTitle.get_title()); } }, function () { }); }
collWebPartobject inexecuteQueryAsyncmethod in any developer tools?