1

Is there any way to change the url property of content editor webpart using Javascript function ? I found solution to change the title of the webpart not the url properties of the web part. ?

function getWebpart()
{
    var ctx = new SP.ClientContext();
    var page = ctx.get_web().getFileByServerRelativeUrl('../SitePages/Home.aspx');
    var wm = page.getLimitedWebPartManager(SP.WebParts.PersonalizationScope.shared);
    debugger
    var webparts = wm.get_webParts();
    ctx.load(webparts,'Include(WebPart)');
    ctx.executeQueryAsync(
    function () {
            for(var i = 0;i < webparts.get_count();i++) {
             var webpart = webparts.getItemAtIndex(i);

              var wp= webpart.get_webPart();
debugger;
              alert(wp.get_title());
if(wp.get_title() == "Content Editor"){
 alert(wp.get_titleUrl());
}
              }
            },
         function(sender,args){
            console.log(args.get_message());
            }
    );
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.